Re: [RFC][PATCH 2/5] mm: Switch mod_state() to __this_cpu_read()

Christoph Lameter
2011-09-19T22:02:18Z

On Mon, 19 Sep 2011, Steven Rostedt wrote:

> From: Steven Rostedt <srostedt@redhat.com>
>
> The code in mod_state() is already made to handle the raciness of
> this_cpu_read(). Have the code use __this_cpu_read() instead so
> the debug code does not trigger warnings about it.

Why would there be a warning triggered? this_cpu_read should take care of
disabling preemption for the read if needed. In fact the fallback case
does do exactly that.

I think it would make more sence if __this_cpu_read() could be made to
trigger a warning if used in context where preemption could be off.