Re: [PATCH RFC tip/core/rcu 11/11] rcu: move TREE_RCU from softirqto kthread

From: Christoph Lameter
Date: Wed Feb 23 2011 - 14:19:25 EST


On Wed, 23 Feb 2011, Steven Rostedt wrote:

> On Wed, 2011-02-23 at 12:29 -0600, Christoph Lameter wrote:
>
> > Right if the kthread context can be rescheduled then either preemption
> > needs to be disabled to guarantee that all three access the same per cpu
> > area data or the code needs to be changed in such a way that a this_cpu
> > RMW instructions can do the mods in one go.
>
> Are you suggesting a this_cpu_atomic_inc()?

this_cpu_inc is already percpu atomic. On x86 it is an instruction that
cannot be interrupted nor preempted while in progress.

There is also this_cpu_cmpxchg() which could be used to do some more
advanced tricks.

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