[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160520162040.GD7086@linux-uzut.site>
Date: Fri, 20 May 2016 09:20:40 -0700
From: Davidlohr Bueso <dave@...olabs.net>
To: Peter Zijlstra <peterz@...radead.org>
Cc: manfred@...orfullife.com, Waiman.Long@....com, mingo@...nel.org,
torvalds@...ux-foundation.org, ggherdovich@...e.com,
mgorman@...hsingularity.net, linux-kernel@...r.kernel.org,
Paul McKenney <paulmck@...ux.vnet.ibm.com>,
Will Deacon <will.deacon@....com>
Subject: Re: sem_lock() vs qspinlocks
On Fri, 20 May 2016, Peter Zijlstra wrote:
>The problem is that the clear_pending_set_locked() is an unordered
>store, therefore this store can be delayed until no later than
>spin_unlock() (which orders against it due to the address dependency).
>
>This opens numerous races; for example:
>
> ipc_lock_object(&sma->sem_perm);
> sem_wait_array(sma);
>
> false -> spin_is_locked(&sma->sem_perm.lock)
>
>is entirely possible, because sem_wait_array() consists of pure reads,
>so the store can pass all that, even on x86.
I had pondered at the unordered stores in clear_pending_set_locked() for arm,
for example, but I _certainly_ missed this for x86 inside the ACQUIRE region.
Thanks,
Davidlohr
Powered by blists - more mailing lists