Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tick/nohz: Use WARN_ON_ONCE() to prevent console saturation

While running some testing on code that happened to allow the variable
tick_nohz_full_running to get set but with no "possible" NOHZ cores to
back up that setting, this warning triggered:

if (unlikely(tick_do_timer_cpu == TICK_DO_TIMER_NONE))
WARN_ON(tick_nohz_full_running);

The console was overwhemled with an endless stream of one WARN per tick
per core and there was no way to even see what was going on w/o using a
serial console to capture it and then trace it back to this.

Change it to WARN_ON_ONCE().

Fixes: 08ae95f4fd3b ("nohz_full: Allow the boot CPU to be nohz_full")
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20211206145950.10927-3-paul.gortmaker@windriver.com

authored by

Paul Gortmaker and committed by
Thomas Gleixner
40e97e42 c54bc0fc

+1 -1
+1 -1
kernel/time/tick-sched.c
··· 188 188 */ 189 189 if (unlikely(tick_do_timer_cpu == TICK_DO_TIMER_NONE)) { 190 190 #ifdef CONFIG_NO_HZ_FULL 191 - WARN_ON(tick_nohz_full_running); 191 + WARN_ON_ONCE(tick_nohz_full_running); 192 192 #endif 193 193 tick_do_timer_cpu = cpu; 194 194 }