From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753563AbcFORzW (ORCPT ); Wed, 15 Jun 2016 13:55:22 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:35520 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751737AbcFORzV (ORCPT ); Wed, 15 Jun 2016 13:55:21 -0400 Date: Wed, 15 Jun 2016 19:55:12 +0200 From: Peter Zijlstra To: Steven Rostedt Cc: mingo@kernel.org, tglx@linutronix.de, juri.lelli@arm.com, xlpang@redhat.com, linux-kernel@vger.kernel.org, mathieu.desnoyers@efficios.com, jdesfossez@efficios.com, bristot@redhat.com, Ingo Molnar Subject: Re: [RFC][PATCH 3/8] sched/deadline/rtmutex: Dont miss the dl_runtime/dl_period update Message-ID: <20160615175512.GV30921@twins.programming.kicks-ass.net> References: <20160607195635.710022345@infradead.org> <20160607200215.788266764@infradead.org> <20160615123007.728b088c@grimm.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160615123007.728b088c@grimm.local.home> 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, Jun 15, 2016 at 12:30:07PM -0400, Steven Rostedt wrote: > > +++ b/kernel/locking/rtmutex.c > > @@ -488,7 +488,7 @@ static int rt_mutex_adjust_prio_chain(st > > * enabled we continue, but stop the requeueing in the chain > > * walk. > > */ > > - if (waiter->prio == task->prio) { > > + if (waiter->prio == task->prio && !dl_task(task)) { > > Isn't task the owner of the lock? No, task is blocked on something. > What happens if the waiter is a > deadline task? So the test here is a shortcut to terminate the Pi chain adjust, it says that if the waiter and task have the same priority, we're done. Further adjustments will not make a difference. The problem is that for deadline tasks, prio is a useless number, so even if they match (all deadline tasks have prio -1) they might still not actually match. After the last patch I suppose we could do something like: waiter->prio == task->prio && waiter->deadline == task->dl.deadline In any case, any condition that compares just two 'prio' values is per definition broken if DL tasks are involved.