lkml.org 
[lkml]   [2011]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: call_function_many: fix list delete vs add race
From
Date
On Mon, 2011-01-31 at 22:17 +0100, Peter Zijlstra wrote:
> That's wrong:
>
> ->foo =
> LOCK
> UNLOCK
> ->bar =
>
> can be re-ordered as:
>
> LOCK
> ->bar =
> ->foo =
> UNLOCK

Can it ? I though UNLOCK had a write barrier semantic ? It does on power
at least :-) It should have since it shall prevent stores inside the
lock region to pass the store of the unlock itself anyways.

So yes, ->bar = can leak into the lock, as can ->foo =, but they can't
be re-ordered vs. each other because the implied barrier will keep ->foo
= in the same "domain" as the unlock itself.

Or do other archs do something really nasty here that don't provide this
guarantee ?

Cheers,
Ben.




\
 
 \ /
  Last update: 2011-02-01 01:25    [from the cache]
©2003-2011 Jasper Spaans