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

Steven Rostedt
2011-09-20T16:07:13Z

On Tue, 2011-09-20 at 10:54 -0500, Christoph Lameter wrote:

> There are significant advantages for counters and things designed to
> operate in an environment where the OS can migrate a task at will.
> Vvmstat and the slub fastpaths exploit these things now and it will be
> possible with these operations to increase the performance of more
> subsystems that way. The page allocator comes to mind.

I'm sorry but correctness beats performance every time! What you have
done seems to be micro optimizations with the sacrifice to correctness.

If you kept the damn this_cpu_*() local to the slab and page allocators,
we may not have even noticed. But you went ahead and made this a very
intrusive invasion into the rest of the kernel, and caused bugs to be
missed everywhere.

-- Steve