From: Roland Dreier I've seen my box paralyzed by an endless spew of rtc: lost some interrupts at 1024Hz. messages on the serial console. What seems to be happening is that something real causes an interrupt to be lost and triggers the message. But then printing the message to the serial console (from the hpet interrupt handler) takes more than 1/1024th of a second, and then some more interrupts are lost, so the message triggers again.... Fix this by adding a printk_ratelimit() before printing the warning. Signed-off-by: Roland Dreier Signed-off-by: Andrew Morton --- arch/i386/kernel/hpet.c | 4 +++- arch/x86_64/kernel/time.c | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff -puN arch/i386/kernel/hpet.c~hpet-avoid-warning-message-livelock arch/i386/kernel/hpet.c --- a/arch/i386/kernel/hpet.c~hpet-avoid-warning-message-livelock +++ a/arch/i386/kernel/hpet.c @@ -480,7 +480,9 @@ static void hpet_rtc_timer_reinit(void) if (lost_ints) { if (hpet_rtc_flags & RTC_PIE) hpet_pie_count += lost_ints; - printk(KERN_WARNING "rtc: lost %d interrupts\n", lost_ints); + if (printk_ratelimit()) + printk(KERN_WARNING "rtc: lost %d interrupts\n", + lost_ints); } } diff -puN arch/x86_64/kernel/time.c~hpet-avoid-warning-message-livelock arch/x86_64/kernel/time.c --- a/arch/x86_64/kernel/time.c~hpet-avoid-warning-message-livelock +++ a/arch/x86_64/kernel/time.c @@ -1212,8 +1212,9 @@ static void hpet_rtc_timer_reinit(void) if (PIE_on) PIE_count += lost_ints; - printk(KERN_WARNING "rtc: lost some interrupts at %ldHz.\n", - hpet_rtc_int_freq); + if (printk_ratelimit()) + printk(KERN_WARNING "rtc: lost some interrupts at %ldHz.\n", + hpet_rtc_int_freq); } } _