Re: [RFC PATCH] printk: Use ACCESS_ONCE() instead of a volatile type

From: Steven Rostedt
Date: Fri Nov 14 2014 - 11:57:59 EST


On Fri, 14 Nov 2014 10:39:34 -0600
Alex Elder <elder@xxxxxxxxxx> wrote:

> There is only one read of logbuf_cpu:
> if (unlikely(logbuf_cpu == this_cpu)) {
> This is called only while local interrupts are disabled, so
> if this condition holds it cannot be due to an interrupt--it

Unless an NMI called printk.

> must be due to simple recursion into printk() while inside
> the spinlock-protected critical section.


> QED. (Well, please correct me where I'm wrong...)
>

Except for the NMI case, I believe you are correct with the rest of
your analysis.

-- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/