Skip to content

Commit c2cf076

Browse files
Zqiangpaulmckrcu
authored andcommitted
rcu: Avoid running boost kthreads on isolated CPUs
When the boost kthreads are created on systems with nohz_full CPUs, the cpus_allowed_ptr is set to housekeeping_cpumask(HK_FLAG_KTHREAD). However, when the rcu_boost_kthread_setaffinity() is called, the original affinity will be changed and these kthreads can subsequently run on nohz_full CPUs. This commit makes rcu_boost_kthread_setaffinity() restrict these boost kthreads to housekeeping CPUs. Signed-off-by: Zqiang <qiang.zhang1211@gmail.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 parent 17ea371 commit c2cf076

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

kernel/rcu/tree_plugin.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1203,8 +1203,9 @@ static void rcu_boost_kthread_setaffinity(struct rcu_node *rnp, int outgoingcpu)
12031203
if ((mask & leaf_node_cpu_bit(rnp, cpu)) &&
12041204
cpu != outgoingcpu)
12051205
cpumask_set_cpu(cpu, cm);
1206+
cpumask_and(cm, cm, housekeeping_cpumask(HK_FLAG_RCU));
12061207
if (cpumask_weight(cm) == 0)
1207-
cpumask_setall(cm);
1208+
cpumask_copy(cm, housekeeping_cpumask(HK_FLAG_RCU));
12081209
set_cpus_allowed_ptr(t, cm);
12091210
free_cpumask_var(cm);
12101211
}

0 commit comments

Comments
 (0)