lkml.org 
[lkml]   [2017]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] locking/mutex: Clear mutex-handoff flag on interrupt
On Wed, Jan 11, 2017 at 05:43:02PM +0100, Peter Zijlstra wrote:
> On Mon, Jan 09, 2017 at 11:52:03AM +0000, Chris Wilson wrote:
> > If we abort the mutex_lock() due to an interrupt, or other error from
>
> s/interrupt/signal/, right?

Yes. EINTR is ingrained.

> > ww_mutex, we need to relinquish the handoff flag if we applied it.
> > Otherwise, we may cause missed wakeups as the current owner may try to
> > handoff to a new thread that is not expecting the handoff and so sleep
> > thinking the lock is already claimed (and since the owner unlocked there
> > may never be a new wakeup).
>
> Isn't that the exact same scenario as Nicolai fixed here:
>
> http://lkml.kernel.org/r/1482346000-9927-3-git-send-email-nhaehnle@gmail.com
>
> Did you, like Nicolai, find this by inspection, or can you reproduce?

Looks like it should be. It takes about 20 minutes of running a stress
test, but it is very reliably hit on the current kernel.

> FWIW, I have the below patch that should also solve this problem afaict.

Thanks, I shall see if makes my machines happy.
-Chris

--
Chris Wilson, Intel Open Source Technology Centre

\
 
 \ /
  Last update: 2017-01-11 17:58    [W:2.032 / U:1.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site