Messages in this thread | | | Subject | Re: call_function_many: fix list delete vs add race | From | Benjamin Herrenschmidt <> | Date | Tue, 01 Feb 2011 11:22:44 +1100 |
| |
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.
| |