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

From: Christoph Lameter
Date: Mon Sep 19 2011 - 18:02:19 EST


On Mon, 19 Sep 2011, Steven Rostedt wrote:

> From: Steven Rostedt <srostedt@xxxxxxxxxx>
>
> 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.

--
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/