Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1542449

[RFC v2 2/5] rcu: Use for_each_leaf_node_cpu() in RCU stall checking

From Boqun Feng <boqun.feng@gmail.com>
Newsgroups linux.kernel
Subject [RFC v2 2/5] rcu: Use for_each_leaf_node_cpu() in RCU stall checking
Date 2016-12-15 03:50 +0100
Message-ID <sOuhj-8sr-7@gated-at.bofh.it> (permalink)
References <sOuhj-8sr-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Use for_each_leaf_node_cpu() in RCU stall checking code, to save some
extra checks, based on the fact that ->qsmask is mostly more sparse than
cpu_possible_mask.

Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
---
 kernel/rcu/tree.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index b56e2dc31ba5..4e5b81c843de 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1417,10 +1417,11 @@ static void rcu_dump_cpu_stacks(struct rcu_state *rsp)
 
 	rcu_for_each_leaf_node(rsp, rnp) {
 		raw_spin_lock_irqsave_rcu_node(rnp, flags);
-		for_each_leaf_node_possible_cpu(rnp, cpu)
-			if (rnp->qsmask & leaf_node_cpu_bit(rnp, cpu))
-				if (!trigger_single_cpu_backtrace(cpu))
-					dump_cpu_task(cpu);
+
+		for_each_leaf_node_cpu(rnp, rnp->qsmask, cpu)
+			if (!trigger_single_cpu_backtrace(cpu))
+				dump_cpu_task(cpu);
+
 		raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
 	}
 }
@@ -1490,13 +1491,12 @@ static void print_other_cpu_stall(struct rcu_state *rsp, unsigned long gpnum)
 	rcu_for_each_leaf_node(rsp, rnp) {
 		raw_spin_lock_irqsave_rcu_node(rnp, flags);
 		ndetected += rcu_print_task_stall(rnp);
-		if (rnp->qsmask != 0) {
-			for_each_leaf_node_possible_cpu(rnp, cpu)
-				if (rnp->qsmask & leaf_node_cpu_bit(rnp, cpu)) {
-					print_cpu_stall_info(rsp, cpu);
-					ndetected++;
-				}
+
+		for_each_leaf_node_cpu(rnp, rnp->qsmask, cpu) {
+			print_cpu_stall_info(rsp, cpu);
+			ndetected++;
 		}
+
 		raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
 	}
 
-- 
2.10.2

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC v2 0/5] rcu: Introduce for_each_leaf_node_cpu() Boqun Feng <boqun.feng@gmail.com> - 2016-12-15 03:50 +0100
  [RFC v2 1/5] rcu: Introduce for_each_leaf_node_cpu() Boqun Feng <boqun.feng@gmail.com> - 2016-12-15 03:50 +0100
    Re: [RFC v2 1/5] rcu: Introduce for_each_leaf_node_cpu() Mark Rutland <mark.rutland@arm.com> - 2016-12-15 12:50 +0100
      Re: [RFC v2 1/5] rcu: Introduce for_each_leaf_node_cpu() Boqun Feng <boqun.feng@gmail.com> - 2016-12-15 15:40 +0100
        Re: [RFC v2 1/5] rcu: Introduce for_each_leaf_node_cpu() Boqun Feng <boqun.feng@gmail.com> - 2016-12-15 16:20 +0100
        Re: [RFC v2 1/5] rcu: Introduce for_each_leaf_node_cpu() Mark Rutland <mark.rutland@arm.com> - 2016-12-15 16:20 +0100
    [RFC v2.1 1/5] rcu: Introduce for_each_leaf_node_cpu() Boqun Feng <boqun.feng@gmail.com> - 2016-12-15 16:30 +0100
      Re: [RFC v2.1 1/5] rcu: Introduce for_each_leaf_node_cpu() Mark Rutland <mark.rutland@arm.com> - 2016-12-15 16:40 +0100
  [RFC v2 2/5] rcu: Use for_each_leaf_node_cpu() in RCU stall checking Boqun Feng <boqun.feng@gmail.com> - 2016-12-15 03:50 +0100
  [RFC v2 4/5] rcu: Use for_each_leaf_node_cpu() in force_qs_rnp() Boqun Feng <boqun.feng@gmail.com> - 2016-12-15 03:50 +0100
    Re: [RFC v2 4/5] rcu: Use for_each_leaf_node_cpu() in force_qs_rnp() Mark Rutland <mark.rutland@arm.com> - 2016-12-15 13:10 +0100
      Re: [RFC v2 4/5] rcu: Use for_each_leaf_node_cpu() in force_qs_rnp() Boqun Feng <boqun.feng@gmail.com> - 2016-12-15 15:50 +0100
        Re: [RFC v2 4/5] rcu: Use for_each_leaf_node_cpu() in force_qs_rnp() Colin Ian King <colin.king@canonical.com> - 2016-12-15 16:00 +0100
          Re: [RFC v2 4/5] rcu: Use for_each_leaf_node_cpu() in force_qs_rnp() Boqun Feng <boqun.feng@gmail.com> - 2016-12-19 16:20 +0100
            Re: [RFC v2 4/5] rcu: Use for_each_leaf_node_cpu() in force_qs_rnp() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-12-20 06:10 +0100
              Re: [RFC v2 4/5] rcu: Use for_each_leaf_node_cpu() in force_qs_rnp() Boqun Feng <boqun.feng@gmail.com> - 2016-12-20 07:00 +0100
                Re: [RFC v2 4/5] rcu: Use for_each_leaf_node_cpu() in force_qs_rnp() Boqun Feng <boqun.feng@gmail.com> - 2016-12-20 09:20 +0100
                Re: [RFC v2 4/5] rcu: Use for_each_leaf_node_cpu() in force_qs_rnp() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-12-20 16:40 +0100
                Re: [RFC v2 4/5] rcu: Use for_each_leaf_node_cpu() in force_qs_rnp() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-12-20 16:30 +0100
                Re: [RFC v2 4/5] rcu: Use for_each_leaf_node_cpu() in force_qs_rnp() Boqun Feng <boqun.feng@gmail.com> - 2016-12-21 03:40 +0100
                Re: [RFC v2 4/5] rcu: Use for_each_leaf_node_cpu() in force_qs_rnp() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-12-21 04:50 +0100
                Re: [RFC v2 4/5] rcu: Use for_each_leaf_node_cpu() in force_qs_rnp() Boqun Feng <boqun.feng@gmail.com> - 2016-12-21 05:20 +0100
                Re: [RFC v2 4/5] rcu: Use for_each_leaf_node_cpu() in force_qs_rnp() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-12-21 17:50 +0100
                Re: [RFC v2 4/5] rcu: Use for_each_leaf_node_cpu() in force_qs_rnp() Boqun Feng <boqun.feng@gmail.com> - 2016-12-22 02:10 +0100
  [RFC v2 5/5] rcu: Use for_each_leaf_node_cpu() in online CPU iteration Boqun Feng <boqun.feng@gmail.com> - 2016-12-15 03:50 +0100
  [RFC v2 3/5] rcu: Use for_each_leaf_node_cpu() in ->expmask iteration Boqun Feng <boqun.feng@gmail.com> - 2016-12-15 03:50 +0100

csiph-web