> -     next = mce_log_get_idx_check(mcelog.next);
> +     next = mcelog.next;
>  
>       /* Only supports full reads right now */
>       err = -EINVAL;
> @@ -281,8 +266,6 @@ static ssize_t mce_chrdev_read(struct file *filp, char 
> __user *ubuf,
>               next = cmpxchg(&mcelog.next, prev, 0);
>       } while (next != prev);
>  
> -     synchronize_sched();

Sorry I take back what I wrote earlier. This RCU is actually still needed,
otherwise the reader could see partially written entries.

So rather have to keep that, and change the read code to run with 
rcu_read_lock()

-Andi

Reply via email to