Thread (20 messages) 20 messages, 3 authors, 2012-05-07

Re: linux-next ppc64: RCU mods cause __might_sleep BUGs

From: Hugh Dickins <hughd@google.com>
Date: 2012-05-02 22:54:27
Also in: lkml

On Wed, May 2, 2012 at 2:54 PM, Paul E. McKenney
[off-list ref] wrote:
On Thu, May 03, 2012 at 07:20:15AM +1000, Benjamin Herrenschmidt wrote:
quoted
On Wed, 2012-05-02 at 13:25 -0700, Hugh Dickins wrote:
quoted
Got it at last. =C2=A0Embarrassingly obvious. =C2=A0__rcu_read_lock() =
and
quoted
quoted
__rcu_read_unlock() are not safe to be using __this_cpu operations,
the cpu may change in between the rmw's read and write: they should
be using this_cpu operations (or, I put preempt_disable/enable in the
__rcu_read_unlock below). =C2=A0__this_cpus there work out fine on x86=
,
quoted
quoted
which was given good instructions to use; but not so well on PowerPC.

I've been running successfully for an hour now with the patch below;
but I expect you'll want to consider the tradeoffs, and may choose a
different solution.
Didn't Linus recently rant about these __this_cpu vs this_cpu nonsense ?

I thought that was going out..
Linus did rant about __raw_get_cpu_var() because it cannot use the x86
%fs segement overrides a bit more than a month ago. =C2=A0The __this_cpu
stuff is useful if you have preemption disabled -- avoids the extra
layer of preempt_disable().

Or was this a different rant?
https://lkml.org/lkml/2011/11/29/321

I think it ended up with Christoph removing the more egregious
variants, but this_cpu_that and __this_cpu_the_other remaining.

Hugh
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help