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

NOHZ: Rate limit the local softirq pending warning output

The warning in the NOHZ code, which triggers when a CPU goes idle with
softirqs pending can fill up the logs quite quickly. Rate limit the output
until we found the root cause of that problem.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Thomas Gleixner and committed by
Linus Torvalds
35282316 43d4f961

+9 -3
+9 -3
kernel/time/tick-sched.c
··· 167 167 goto end; 168 168 169 169 cpu = smp_processor_id(); 170 - if (unlikely(local_softirq_pending())) 171 - printk(KERN_ERR "NOHZ: local_softirq_pending %02x\n", 172 - local_softirq_pending()); 170 + if (unlikely(local_softirq_pending())) { 171 + static int ratelimit; 172 + 173 + if (ratelimit < 10) { 174 + printk(KERN_ERR "NOHZ: local_softirq_pending %02x\n", 175 + local_softirq_pending()); 176 + ratelimit++; 177 + } 178 + } 173 179 174 180 now = ktime_get(); 175 181 /*