From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754597AbcJEIdD (ORCPT ); Wed, 5 Oct 2016 04:33:03 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:43038 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753085AbcJEIdC (ORCPT ); Wed, 5 Oct 2016 04:33:02 -0400 Date: Wed, 5 Oct 2016 10:32:53 +0200 From: Peter Zijlstra To: Sebastian Andrzej Siewior Cc: mingo@kernel.org, tglx@linutronix.de, juri.lelli@arm.com, rostedt@goodmis.org, xlpang@redhat.com, linux-kernel@vger.kernel.org, mathieu.desnoyers@efficios.com, jdesfossez@efficios.com, bristot@redhat.com Subject: Re: [RFC][PATCH 4/4] futex: Rewrite FUTEX_UNLOCK_PI Message-ID: <20161005083253.GG3142@twins.programming.kicks-ass.net> References: <20161003091234.879763059@infradead.org> <20161003091847.704255067@infradead.org> <20161005074147.qws2fx2n3o56y2r4@linutronix.de> <20161005080912.GF3142@twins.programming.kicks-ass.net> <20161005082102.lm3jze3hzikkzxcg@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161005082102.lm3jze3hzikkzxcg@linutronix.de> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 05, 2016 at 10:21:02AM +0200, Sebastian Andrzej Siewior wrote: > On 2016-10-05 10:09:12 [+0200], Peter Zijlstra wrote: > > On Wed, Oct 05, 2016 at 09:41:47AM +0200, Sebastian Andrzej Siewior wrote: > > > are those problems DL related? > > > > One of them, the other is that PI thing you did that ugly nodeboost > > thing for, right? > > this no-de-boost yes. This is probably a problem since we have this > "delayed" wake-up. I've been thinking about a marked in PI state to > ignore a de-boost so the spin_unlock() won't be a problem. But if I > understand it right, then this won't solve the DL problem since you > can't have two tasks at the same priority. The primary concern for DL right now is being able to have a stable pointer to the top waiter. We do this by having rt_mutex_setprio() update the pointer while holding both rq->lock and tsk->pi_lock. This means the pointer is stable when holding either lock, which is sufficient. But this means, we need to deboost _before_ we wake. Otherwise the task could've continued running and called do_exit() on us. Secondary, once we start looking at BWI (bandwidth inheritance), where a blocked DL task donates its runtime budget along with its deadline, we also very much need this, since a task cannot be running of its own budget while at the same time the boosted task is also running off that same budget. (having the 'blocked' DL task spin-waiting, as per optimistic spinning, makes all that rather 'interesting'). In any case, this is two problems: - your inversion issue - my pointer stability (and eventually bandwidth issue) that are caused by this hb->lock being in the way.