diff options
| author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2018-05-02 14:07:02 -0400 | 
|---|---|---|
| committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2018-07-12 18:39:01 -0400 | 
| commit | 928164351e700f91ab588f20fe470cac9db477a9 (patch) | |
| tree | 93f0a4ee3c9bfb55d1dce30628e68c801f28bd0b /kernel/rcu/tree.c | |
| parent | 91f63ced7dc4e80acd13386204327d5de00a672d (diff) | |
rcu: Prevent useless FQS scan after all CPUs have checked in
The force_qs_rnp() function checks for ->qsmask being all zero, that is,
all CPUs for the current rcu_node structure having already passed through
quiescent states.  But with RCU-preempt, this is not sufficient to report
quiescent states further up the tree, so there are further checks that
can initiate RCU priority boosting and also for races with CPU-hotplug
operations.  However, if neither of these further checks apply, the code
proceeds to carry out a useless scan of an all-zero ->qsmask.
This commit therefore adds code to release the current rcu_node
structure's lock and continue on to the next rcu_node structure, thereby
avoiding this useless scan.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcu/tree.c')
| -rw-r--r-- | kernel/rcu/tree.c | 2 | 
1 files changed, 2 insertions, 0 deletions
| diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 439228b79811..3efd591fcd15 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c | |||
| @@ -2672,6 +2672,8 @@ static void force_qs_rnp(struct rcu_state *rsp, int (*f)(struct rcu_data *rsp)) | |||
| 2672 | /* rcu_report_unblock_qs_rnp() rlses ->lock */ | 2672 | /* rcu_report_unblock_qs_rnp() rlses ->lock */ | 
| 2673 | continue; | 2673 | continue; | 
| 2674 | } | 2674 | } | 
| 2675 | raw_spin_unlock_irqrestore_rcu_node(rnp, flags); | ||
| 2676 | continue; | ||
| 2675 | } | 2677 | } | 
| 2676 | for_each_leaf_node_possible_cpu(rnp, cpu) { | 2678 | for_each_leaf_node_possible_cpu(rnp, cpu) { | 
| 2677 | unsigned long bit = leaf_node_cpu_bit(rnp, cpu); | 2679 | unsigned long bit = leaf_node_cpu_bit(rnp, cpu); | 
