Re: [PATCH] ipc/sem: Fix race between to-be-woken task and waker

2019-09-30 Thread Waiman Long
On 9/29/19 6:24 AM, Manfred Spraul wrote: > Hi Waiman, > > I have now written the mail 3 times: > Twice I thought that I found a race, but during further analysis, it > always turns out that the spin_lock() is sufficient. > > First, to avoid any obvious things: Until the series with e.g. >

Re: [PATCH] ipc/sem: Fix race between to-be-woken task and waker

2019-09-29 Thread Manfred Spraul
Hi Waiman, I have now written the mail 3 times: Twice I thought that I found a race, but during further analysis, it always turns out that the spin_lock() is sufficient. First, to avoid any obvious things: Until the series with e.g. 27d7be1801a4824e, there was a race inside sem_lock().

Re: [PATCH] ipc/sem: Fix race between to-be-woken task and waker

2019-09-26 Thread Manfred Spraul
Hi, On 9/26/19 8:12 PM, Waiman Long wrote: On 9/26/19 5:34 AM, Peter Zijlstra wrote: On Fri, Sep 20, 2019 at 11:54:02AM -0400, Waiman Long wrote: While looking at a customr bug report about potential missed wakeup in the system V semaphore code, I spot a potential problem. The fact that

Re: [PATCH] ipc/sem: Fix race between to-be-woken task and waker

2019-09-26 Thread Waiman Long
On 9/26/19 5:34 AM, Peter Zijlstra wrote: > On Fri, Sep 20, 2019 at 11:54:02AM -0400, Waiman Long wrote: >> While looking at a customr bug report about potential missed wakeup in >> the system V semaphore code, I spot a potential problem. The fact that >> semaphore waiter stays in TASK_RUNNING

Re: [PATCH] ipc/sem: Fix race between to-be-woken task and waker

2019-09-26 Thread Peter Zijlstra
On Fri, Sep 20, 2019 at 11:54:02AM -0400, Waiman Long wrote: > While looking at a customr bug report about potential missed wakeup in > the system V semaphore code, I spot a potential problem. The fact that > semaphore waiter stays in TASK_RUNNING state while checking queue status > may lead to

[PATCH] ipc/sem: Fix race between to-be-woken task and waker

2019-09-20 Thread Waiman Long
While looking at a customr bug report about potential missed wakeup in the system V semaphore code, I spot a potential problem. The fact that semaphore waiter stays in TASK_RUNNING state while checking queue status may lead to missed wakeup if a spurious wakeup happens in the right moment as