mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-30 08:02:30 +00:00
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 <paulmck@kernel.org>
This commit is contained in:
parent
e1350e8e0e
commit
7441e7661d
1 changed files with 5 additions and 8 deletions
|
@ -2298,14 +2298,11 @@ static void force_qs_rnp(int (*f)(struct rcu_data *rdp))
|
||||||
raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
|
raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for_each_leaf_node_possible_cpu(rnp, cpu) {
|
for_each_leaf_node_cpu_mask(rnp, cpu, rnp->qsmask) {
|
||||||
unsigned long bit = leaf_node_cpu_bit(rnp, cpu);
|
rdp = per_cpu_ptr(&rcu_data, cpu);
|
||||||
if ((rnp->qsmask & bit) != 0) {
|
if (f(rdp)) {
|
||||||
rdp = per_cpu_ptr(&rcu_data, cpu);
|
mask |= rdp->grpmask;
|
||||||
if (f(rdp)) {
|
rcu_disable_urgency_upon_qs(rdp);
|
||||||
mask |= bit;
|
|
||||||
rcu_disable_urgency_upon_qs(rdp);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mask != 0) {
|
if (mask != 0) {
|
||||||
|
|
Loading…
Reference in a new issue