From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753674AbbDGWNo (ORCPT ); Tue, 7 Apr 2015 18:13:44 -0400 Received: from e37.co.us.ibm.com ([32.97.110.158]:52108 "EHLO e37.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751531AbbDGWNl (ORCPT ); Tue, 7 Apr 2015 18:13:41 -0400 Date: Tue, 7 Apr 2015 15:13:35 -0700 From: "Paul E. McKenney" To: Patrick Daly Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] rcu: Fix missing task information during rcu-preempt stall Message-ID: <20150407221335.GN5668@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <1428436993-31834-1-git-send-email-pdaly@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1428436993-31834-1-git-send-email-pdaly@codeaurora.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15040722-0025-0000-0000-000009B8690A Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 07, 2015 at 01:03:13PM -0700, Patrick Daly wrote: > The first item list_for_each_entry_continue(alist) iterates over is > alist->next, rather than alist itself. Consequently, > rcu_print_detail_task_stall_rnp() skips the task referenced by gp_tasks. > > Use gp_tasks->prev as the argument to list_for_each_entry_continue() > instead. Good catch, thank you! Queued for v4.2. Thanx, Paul > Signed-off-by: Patrick Daly > --- > kernel/rcu/tree_plugin.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h > index d1dda52..9fbecdc 100644 > --- a/kernel/rcu/tree_plugin.h > +++ b/kernel/rcu/tree_plugin.h > @@ -459,7 +459,7 @@ static void rcu_print_detail_task_stall_rnp(struct rcu_node *rnp) > raw_spin_unlock_irqrestore(&rnp->lock, flags); > return; > } > - t = list_entry(rnp->gp_tasks, > + t = list_entry(rnp->gp_tasks->prev, > struct task_struct, rcu_node_entry); > list_for_each_entry_continue(t, &rnp->blkd_tasks, rcu_node_entry) > sched_show_task(t); > @@ -524,7 +524,7 @@ static int rcu_print_task_stall(struct rcu_node *rnp) > if (!rcu_preempt_blocked_readers_cgp(rnp)) > return 0; > rcu_print_task_stall_begin(rnp); > - t = list_entry(rnp->gp_tasks, > + t = list_entry(rnp->gp_tasks->prev, > struct task_struct, rcu_node_entry); > list_for_each_entry_continue(t, &rnp->blkd_tasks, rcu_node_entry) { > printk(KERN_CONT " P%d", t->pid); > -- > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project >