public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rcu: Avoid unnecessary contention of rcu node lock
@ 2016-11-09  8:57 Byungchul Park
  2016-11-16  4:49 ` Byungchul Park
  0 siblings, 1 reply; 5+ messages in thread
From: Byungchul Park @ 2016-11-09  8:57 UTC (permalink / raw)
  To: paulmck, josh, rostedt, mathieu.desnoyers, jiangshanlai; +Cc: linux-kernel

It's unnecessary to try to print stacks of blocked tasks in the case
that ndetected == 0. Furthermore, calling rcu_print_detail_task_stall()
causes to acquire rnp locks as many times as the number of leaf nodes
plus one for root node. It's unnecessary at all in the case.

Signed-off-by: Byungchul Park <byungchul.park@lge.com>
---
 kernel/rcu/tree.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 287f468..ab2f743 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1374,6 +1374,9 @@ static void print_other_cpu_stall(struct rcu_state *rsp, unsigned long gpnum)
 	       (long)rsp->gpnum, (long)rsp->completed, totqlen);
 	if (ndetected) {
 		rcu_dump_cpu_stacks(rsp);
+
+		/* Complain about tasks blocking the grace period. */
+		rcu_print_detail_task_stall(rsp);
 	} else {
 		if (READ_ONCE(rsp->gpnum) != gpnum ||
 		    READ_ONCE(rsp->completed) == gpnum) {
@@ -1390,9 +1393,6 @@ static void print_other_cpu_stall(struct rcu_state *rsp, unsigned long gpnum)
 		}
 	}
 
-	/* Complain about tasks blocking the grace period. */
-	rcu_print_detail_task_stall(rsp);
-
 	rcu_check_gp_kthread_starvation(rsp);
 
 	panic_on_rcu_stall();
-- 
1.9.1

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

end of thread, other threads:[~2016-11-17  3:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-09  8:57 [PATCH] rcu: Avoid unnecessary contention of rcu node lock Byungchul Park
2016-11-16  4:49 ` Byungchul Park
2016-11-16 13:59   ` Steven Rostedt
2016-11-16 19:29   ` Paul E. McKenney
2016-11-17  3:38     ` Byungchul Park

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