Re: [PATCH RFC tip/core/rcu 11/12] rcu: fix race condition in synchronize_sched_expedited()
From: Tejun Heo
Date: Thu Nov 11 2010 - 07:53:35 EST
Hello,
On 11/11/2010 01:31 PM, Paul E. McKenney wrote:
> Actually, the memory barriers are still one source of discomfort to me.
> I am concerned about the path out of the function that skips the
> atomic_cmpxchg(), which seem to happen if some concurrent invocation
> advances the "done" counter past us before we get around to checking it.
> I agree on the atomic_inc_return() upon entry to the function, though.
Oooh, you're right. It needs to be smp_mb(). We can put it right
before break but I don't think it would worth the ugliness.
> And this is going to need some serious testing either way. ;-)
Definitely. This is a scary piece of code. :-)
--
tejun
--
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/