Skip to content

Commit 7441e76

Browse files
committed
rcu: Switch force_qs_rnp() to for_each_leaf_node_cpu_mask()
Currently, force_qs_rnp() uses a for_each_leaf_node_possible_cpu() loop containing a check of the current CPU's bit in ->qsmask. This works, but this commit saves three lines by instead using for_each_leaf_node_cpu_mask(), which combines the functionality of for_each_leaf_node_possible_cpu() and leaf_node_cpu_bit(). This commit also replaces the use of the local variable "bit" with rdp->grpmask. Signed-off-by: Paul E. McKenney <[email protected]>
1 parent e1350e8 commit 7441e76

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

kernel/rcu/tree.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2298,14 +2298,11 @@ static void force_qs_rnp(int (*f)(struct rcu_data *rdp))
22982298
raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
22992299
continue;
23002300
}
2301-
for_each_leaf_node_possible_cpu(rnp, cpu) {
2302-
unsigned long bit = leaf_node_cpu_bit(rnp, cpu);
2303-
if ((rnp->qsmask & bit) != 0) {
2304-
rdp = per_cpu_ptr(&rcu_data, cpu);
2305-
if (f(rdp)) {
2306-
mask |= bit;
2307-
rcu_disable_urgency_upon_qs(rdp);
2308-
}
2301+
for_each_leaf_node_cpu_mask(rnp, cpu, rnp->qsmask) {
2302+
rdp = per_cpu_ptr(&rcu_data, cpu);
2303+
if (f(rdp)) {
2304+
mask |= rdp->grpmask;
2305+
rcu_disable_urgency_upon_qs(rdp);
23092306
}
23102307
}
23112308
if (mask != 0) {

0 commit comments

Comments
 (0)