From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932775AbdCGOqg (ORCPT ); Tue, 7 Mar 2017 09:46:36 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:41769 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755326AbdCGOoU (ORCPT ); Tue, 7 Mar 2017 09:44:20 -0500 Date: Tue, 7 Mar 2017 14:26:37 +0100 (CET) From: Thomas Gleixner To: Peter Zijlstra cc: mingo@kernel.org, juri.lelli@arm.com, rostedt@goodmis.org, xlpang@redhat.com, bigeasy@linutronix.de, linux-kernel@vger.kernel.org, mathieu.desnoyers@efficios.com, jdesfossez@efficios.com, bristot@redhat.com, dvhart@infradead.org Subject: Re: [PATCH -v5 09/14] futex: Rework inconsistent rt_mutex/futex_q state In-Reply-To: <20170304093559.349677973@infradead.org> Message-ID: References: <20170304092717.762954142@infradead.org> <20170304093559.349677973@infradead.org> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 4 Mar 2017, Peter Zijlstra wrote: > @@ -1402,12 +1402,18 @@ static int wake_futex_pi(u32 __user *uad > new_owner = rt_mutex_next_owner(&pi_state->pi_mutex); > > /* > - * It is possible that the next waiter (the one that brought > - * top_waiter owner to the kernel) timed out and is no longer > - * waiting on the lock. > + * When we interleave with futex_lock_pi() where it does > + * rt_mutex_timed_futex_lock(), we might observe @this futex_q waiter, > + * but the rt_mutex's wait_list can be empty (either still, or again, > + * depending on which side we land). > + * > + * When this happens, give up our locks and try again, giving the > + * futex_lock_pi() instance time to complete and unqueue_me(). time to complete, either by waiting on the rtmutex or removing itself from the futex queue. Or something like that. Thanks, tglx