[lkml]   [2017]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
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:
> 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 Wilson, Intel Open Source Technology Centre

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