Skip to content

Commit 40e97e4

Browse files
Paul GortmakerKAGA-KOKO
authored andcommitted
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: 08ae95f ("nohz_full: Allow the boot CPU to be nohz_full") Signed-off-by: Paul Gortmaker <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected]
1 parent c54bc0f commit 40e97e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/time/tick-sched.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ static void tick_sched_do_timer(struct tick_sched *ts, ktime_t now)
188188
*/
189189
if (unlikely(tick_do_timer_cpu == TICK_DO_TIMER_NONE)) {
190190
#ifdef CONFIG_NO_HZ_FULL
191-
WARN_ON(tick_nohz_full_running);
191+
WARN_ON_ONCE(tick_nohz_full_running);
192192
#endif
193193
tick_do_timer_cpu = cpu;
194194
}

0 commit comments

Comments
 (0)