Skip to contentSkip to conversation

rcutorture: Traverse possible cpu to set maxcpu in rcu_nocb_toggle()

PATCH New Zqiang 1 participant 1 message Aug 24, 2023

Subsystems (2)
lore
Share & tools
lore

Zqiang

author
#0 lore raw

PATCH 1/1 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 commit therefore use for_each_possible_cpu() instead of for_each_online_cpu() in rcu_nocb_toggle().

---
 kernel/rcu/rcutorture.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/rcu/rcutorture.c +1 -1
index a58372bdf0c1..b75d0fe558ce 100644
@@ -2131,7 +2131,7 @@ static int rcu_nocb_toggle(void *arg)
 	VERBOSE_TOROUT_STRING("rcu_nocb_toggle task started");
 	while (!rcu_inkernel_boot_has_ended())
 		schedule_timeout_interruptible(HZ / 10);
-	for_each_online_cpu(cpu)
+	for_each_possible_cpu(cpu)
 		maxcpu = cpu;
 	WARN_ON(maxcpu < 0);
 	if (toggle_interval > ULONG_MAX)
Signature · 1 line
2.17.1