public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rcu: Fix missing task information during rcu-preempt stall
@ 2015-04-07 20:03 Patrick Daly
  2015-04-07 22:13 ` Paul E. McKenney
  0 siblings, 1 reply; 2+ messages in thread
From: Patrick Daly @ 2015-04-07 20:03 UTC (permalink / raw)
  To: linux-kernel, paulmck; +Cc: Patrick Daly

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.

Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] rcu: Fix missing task information during rcu-preempt stall
  2015-04-07 20:03 [PATCH] rcu: Fix missing task information during rcu-preempt stall Patrick Daly
@ 2015-04-07 22:13 ` Paul E. McKenney
  0 siblings, 0 replies; 2+ messages in thread
From: Paul E. McKenney @ 2015-04-07 22:13 UTC (permalink / raw)
  To: Patrick Daly; +Cc: linux-kernel

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 <pdaly@codeaurora.org>
> ---
>  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
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-07 22:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-07 20:03 [PATCH] rcu: Fix missing task information during rcu-preempt stall Patrick Daly
2015-04-07 22:13 ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox