From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752790AbcFNU2n (ORCPT ); Tue, 14 Jun 2016 16:28:43 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:49555 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751392AbcFNU2m (ORCPT ); Tue, 14 Jun 2016 16:28:42 -0400 Date: Tue, 14 Jun 2016 22:28:34 +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 2/8] sched/rtmutex/deadline: Fix a PI crash for deadline tasks Message-ID: <20160614202834.GF30909@twins.programming.kicks-ass.net> References: <20160607195635.710022345@infradead.org> <20160607200215.719626477@infradead.org> <20160614144217.2b5e71ad@grimm.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160614144217.2b5e71ad@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 Tue, Jun 14, 2016 at 02:42:17PM -0400, Steven Rostedt wrote: > On Tue, 07 Jun 2016 21:56:37 +0200 > Peter Zijlstra wrote: > > + /* > > + * We should deboost before waking the top waiter task such that > > + * we don't run two tasks with the 'same' priority. This however > > + * can lead to prio-inversion if we would get preempted after > > + * the deboost but before waking our high-prio task, hence the > > + * preempt_disable before unlock. Pairs with preempt_enable() in > > + * rt_mutex_postunlock(); > > + */ > > + preempt_disable(); > > + > > This looks like a possible maintenance nightmare. Can we add some more > comments at the start of the functions that state that > rt_mutex_slowunlock() calls must be paired with rt_mutex_postunlock()? Please look at patches 4 and 5 that clean this up.