Re: [PATCH linux-next][RFC]torture: avoid offline tick_do_timer_cpu

From
Frederic Weisbecker <frederic@kernel.org>
Date
2022-11-23 22:25:54
Also in
lkml
Reply to
Paul E. McKenney, 2022-11-22
On Mon, Nov 21, 2022 at 05:37:54PM -0800, Paul E. McKenney wrote:
On Mon, Nov 21, 2022 at 11:51:40AM +0800, Zhouyi Zhou wrote:
quoted
@@ -358,7 +359,16 @@ torture_onoff(void *arg)
 			schedule_timeout_interruptible(HZ / 10);
 			continue;
 		}
+#ifdef CONFIG_NO_HZ_FULL
+		/* do not offline tick do timer cpu */
+		if (tick_nohz_full_running) {
+			cpu = (torture_random(&rand) >> 4) % maxcpu;
+			if (cpu >= tick_do_timer_cpu)
Why is this ">=" instead of "=="?
quoted
+				cpu = (cpu + 1) % (maxcpu + 1);
+		} else
+#else
 		cpu = (torture_random(&rand) >> 4) % (maxcpu + 1);
+#endif
What happens if the value of tick_do_timer_cpu changes between the time of
the check above and the call to torture_offline() below?  Alternatively,
how is such a change in value prevented?
It can't, currently tick_do_timer_cpu is fixed when nohz_full is running.
It can however have special values at early boot such as TICK_DO_TIMER_NONE.
But if rcutorture is initialized after smp, it should be ok.

Thanks.
							Thanx, Paul
quoted
 		if (!torture_offline(cpu,
 				     &n_offline_attempts, &n_offline_successes,
 				     &sum_offline, &min_offline, &max_offline))
-- 
2.34.1
Thread (18 messages) 18 messages, 5 authors, last reply 2023-07-06
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help