Skip to content

Commit 771a92b

Browse files
ZqiangFrederic Weisbecker
authored andcommitted
rcutorture: Traverse possible cpu to set maxcpu in rcu_nocb_toggle()
Currently, the maxcpu is set by traversing online CPUs, however, if the rcutorture.onoff_holdoff is set zero and onoff_interval is set non-zero, and the some CPUs with larger cpuid has been offline before setting maxcpu, for these CPUs, even if they are online again, also cannot be offload or deoffload. This can result in rcutorture attempting to (de-)offload CPUs that have never been online, but the (de-)offload code handles this. This commit therefore use for_each_possible_cpu() instead of for_each_online_cpu() in rcu_nocb_toggle(). Signed-off-by: Zqiang <qiang.zhang1211@gmail.com> Reviewed-by: Frederic Weisbecker <frederic@kernel.org> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
1 parent 66bcb13 commit 771a92b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/rcu/rcutorture.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2126,7 +2126,7 @@ static int rcu_nocb_toggle(void *arg)
21262126
VERBOSE_TOROUT_STRING("rcu_nocb_toggle task started");
21272127
while (!rcu_inkernel_boot_has_ended())
21282128
schedule_timeout_interruptible(HZ / 10);
2129-
for_each_online_cpu(cpu)
2129+
for_each_possible_cpu(cpu)
21302130
maxcpu = cpu;
21312131
WARN_ON(maxcpu < 0);
21322132
if (toggle_interval > ULONG_MAX)

0 commit comments

Comments
 (0)