Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932153AbcDTNtr (ORCPT ); Wed, 20 Apr 2016 09:49:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45933 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752644AbcDTNtp (ORCPT ); Wed, 20 Apr 2016 09:49:45 -0400 Reply-To: xlpang@redhat.com Subject: Re: [PATCH v3 2/6] sched/rtmutex/deadline: Fix a PI crash for deadline tasks References: <1460633827-345-1-git-send-email-xlpang@redhat.com> <1460633827-345-3-git-send-email-xlpang@redhat.com> <20160420131932.GC3430@twins.programming.kicks-ass.net> To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Juri Lelli , Ingo Molnar , Steven Rostedt From: Xunlei Pang Message-ID: <571788F6.3020100@redhat.com> Date: Wed, 20 Apr 2016 21:49:42 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20160420131932.GC3430@twins.programming.kicks-ass.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 20 Apr 2016 13:49:45 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 700 Lines: 19 On 2016/04/20 at 21:19, Peter Zijlstra wrote: > 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? I meant to make it semantically consistent, but I can change it since you think task_struct is better. Regards, Xunlei