Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932675AbcDTNTi (ORCPT ); Wed, 20 Apr 2016 09:19:38 -0400 Received: from merlin.infradead.org ([205.233.59.134]:38056 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932598AbcDTNTh (ORCPT ); Wed, 20 Apr 2016 09:19:37 -0400 Date: Wed, 20 Apr 2016 15:19:32 +0200 From: Peter Zijlstra To: Xunlei Pang Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Juri Lelli , Ingo Molnar , Steven Rostedt Subject: Re: [PATCH v3 2/6] sched/rtmutex/deadline: Fix a PI crash for deadline tasks Message-ID: <20160420131932.GC3430@twins.programming.kicks-ass.net> References: <1460633827-345-1-git-send-email-xlpang@redhat.com> <1460633827-345-3-git-send-email-xlpang@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1460633827-345-3-git-send-email-xlpang@redhat.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 520 Lines: 15 On Thu, Apr 14, 2016 at 07:37:03PM +0800, Xunlei Pang wrote: > + /* Updated under pi_lock and rtmutex lock */ > struct rb_node *pi_waiters_leftmost; > + struct rb_node *pi_waiters_leftmost_copy; > struct task_struct *rt_mutex_get_top_task(struct task_struct *task) > { > + if (!task->pi_waiters_leftmost_copy) > return NULL; > > + return rb_entry(task->pi_waiters_leftmost_copy, > + struct rt_mutex_waiter, pi_tree_entry)->task; > } why ?! Why not keep a regular task_struct pointer and avoid this stuff?