From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752830AbcFNToU (ORCPT ); Tue, 14 Jun 2016 15:44:20 -0400 Received: from merlin.infradead.org ([205.233.59.134]:36779 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752182AbcFNToM (ORCPT ); Tue, 14 Jun 2016 15:44:12 -0400 Date: Tue, 14 Jun 2016 21:44:01 +0200 From: Peter Zijlstra To: Juri Lelli Cc: mingo@kernel.org, tglx@linutronix.de, 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 8/8] rtmutex: Fix PI chain order integrity Message-ID: <20160614194401.GL30921@twins.programming.kicks-ass.net> References: <20160607195635.710022345@infradead.org> <20160607200216.117270606@infradead.org> <20160614173908.GQ5981@e106622-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160614173908.GQ5981@e106622-lin> 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 Tue, Jun 14, 2016 at 06:39:08PM +0100, Juri Lelli wrote: > On 07/06/16 21:56, Peter Zijlstra wrote: > > rt_mutex_waiter::prio is a copy of task_struct::prio which is updated > > during the PI chain walk, such that the PI chain order isn't messed up > > by (asynchronous) task state updates. > > > > Currently rt_mutex_waiter_less() uses task state for deadline tasks; > > this is broken, since the task state can, as said above, change > > asynchronously, causing the RB tree order to change without actual > > tree update -> FAIL. > > > > Fix this by also copying the deadline into the rt_mutex_waiter state > > and updating it along with its prio field. > > > > Ideally we would also force PI chain updates whenever DL tasks update > > their deadline parameter, but for first approximation this is less > > broken than it was. > > > > The patch looks OK to me. However, I'm failing to see when we can update > dl.deadline of a waiter asynchronously. Since a waiter is blocked, we > can't really change his dl.deadline by calling setscheduler on him, as > the update would operate on dl.dl_deadline. The new values will start to > be used as soon as it gets unblocked. The situation seems different for > RT tasks, for which priority change takes effect immediately. > > What am I missing? :-) Ah, I missed the dl_deadline vs deadline thing. Still, with optimistic spinning the waiter could hit its throttle/refresh path, right? And then that would update deadline.