From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754250AbdDMQJi (ORCPT ); Thu, 13 Apr 2017 12:09:38 -0400 Received: from mail.kernel.org ([198.145.29.136]:53098 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751605AbdDMQJe (ORCPT ); Thu, 13 Apr 2017 12:09:34 -0400 Date: Thu, 13 Apr 2017 12:09:25 -0400 From: Steven Rostedt To: Peter Zijlstra Cc: Alex Shi , mingo@redhat.com, corbet@lwn.net, "open list:LOCKING PRIMITIVES" , Sebastian Siewior , Thomas Gleixner Subject: Re: [PATCH 2/3] rtmutex: deboost priority conditionally when rt-mutex unlock Message-ID: <20170413120925.76e22c03@gandalf.local.home> In-Reply-To: <20170413143952.ty4dw5mvyfnhaqgh@hirez.programming.kicks-ass.net> References: <1492092174-31734-1-git-send-email-alex.shi@linaro.org> <1492092174-31734-3-git-send-email-alex.shi@linaro.org> <20170413143952.ty4dw5mvyfnhaqgh@hirez.programming.kicks-ass.net> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 13 Apr 2017 16:39:52 +0200 Peter Zijlstra wrote: > On Thu, Apr 13, 2017 at 10:02:53PM +0800, Alex Shi wrote: > > /* > > + * 'current' release this lock, so 'current' should be a higher prio > > + * task than the next top waiter, unless the current prio was gotten > > + * from this top waiter, iff so, we need to deboost 'current' after > > + * the lock release. > > + */ > > + if (current->prio == waiter->prio) > > + deboost = true; > > This is wrong. The comment is, especially that "iff". What if current and waiter happen to have the same priority? Then it too doesn't need to be deboosted. But that said, we currently perform the deboost unconditionally. I can't think of a case where current->prio != waiter->prio where we should perform the deboost, because current->prio should always be <= waiter->prio (where lower prio means higher priority). Maybe I'm missing something. -- Steve