Merge tag 'timers_urgent_for_v5.16_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull timer fix from Borislav Petkov:

- Prevent a tick storm when a dedicated timekeeper CPU in nohz_full
mode runs for prolonged periods with interrupts disabled and ends up
programming the next tick in the past, leading to that storm

* tag 'timers_urgent_for_v5.16_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
timers/nohz: Last resort update jiffies on nohz_full IRQ entry

Changed files
+9 -1
kernel
+2 -1
kernel/softirq.c
··· 595 595 { 596 596 __irq_enter_raw(); 597 597 598 - if (is_idle_task(current) && (irq_count() == HARDIRQ_OFFSET)) 598 + if (tick_nohz_full_cpu(smp_processor_id()) || 599 + (is_idle_task(current) && (irq_count() == HARDIRQ_OFFSET))) 599 600 tick_irq_enter(); 600 601 601 602 account_hardirq_enter(current);
+7
kernel/time/tick-sched.c
··· 1375 1375 now = ktime_get(); 1376 1376 if (ts->idle_active) 1377 1377 tick_nohz_stop_idle(ts, now); 1378 + /* 1379 + * If all CPUs are idle. We may need to update a stale jiffies value. 1380 + * Note nohz_full is a special case: a timekeeper is guaranteed to stay 1381 + * alive but it might be busy looping with interrupts disabled in some 1382 + * rare case (typically stop machine). So we must make sure we have a 1383 + * last resort. 1384 + */ 1378 1385 if (ts->tick_stopped) 1379 1386 tick_nohz_update_jiffies(now); 1380 1387 }