lkml.org 
[lkml]   [2016]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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

\
 
 \ /
  Last update: 2016-05-20 18:41    [W:0.476 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site