From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752547AbcFNOIl (ORCPT ); Tue, 14 Jun 2016 10:08:41 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:35462 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751132AbcFNOIk (ORCPT ); Tue, 14 Jun 2016 10:08:40 -0400 Date: Tue, 14 Jun 2016 16:08:27 +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 6/8] sched/rtmutex: Refactor rt_mutex_setprio() Message-ID: <20160614140827.GB3704@worktop> References: <20160607195635.710022345@infradead.org> <20160607200215.990237037@infradead.org> <20160614131424.GK5981@e106622-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160614131424.GK5981@e106622-lin> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 14, 2016 at 02:14:24PM +0100, Juri Lelli wrote: > Hi, > > still digesting this change, but I'll point out below why I think you > are hitting a NULL ptr dereference (discussed on IRC). > > On 07/06/16 21:56, Peter Zijlstra wrote: > > > --- a/kernel/locking/rtmutex.c > > +++ b/kernel/locking/rtmutex.c > > @@ -256,61 +256,16 @@ rt_mutex_dequeue_pi(struct task_struct * > > RB_CLEAR_NODE(&waiter->pi_tree_entry); > > } > > > > +static void rt_mutex_adjust_prio(struct task_struct *p) > > { > > + struct task_struct *pi_task = NULL; > > > > + lockdep_assert_held(&p->pi_lock); > > > > + if (!task_has_pi_waiters(p)) > > Shouldn't this be the other way around? > > if (task_has_pi_waiters(p)) > pi_task = ... Yeah, that would make more sense :-)