Re: [patch 01/12] clockevents: Prevent timer interrupt starvation

From: Nathan Chancellor

Date: Fri Apr 10 2026 - 17:13:27 EST


On Fri, Apr 10, 2026 at 11:02:13PM +0200, Thomas Gleixner wrote:
> On Fri, Apr 10 2026 at 13:52, Nathan Chancellor wrote:
> >> Link: https://lore.kernel.org/lkml/acMe-QZUel-bBYUh@xxxxxxxxxxxxx/
> >
> > This change in -next as commit 1c2eabb8805d ("clockevents: Prevent timer
> > interrupt starvation") appears to make one of my test machines
> > consistently lock up on boot (at least I never get to userspace). Most
> > of the time I get stall messages such as
>
> Can you please retest the changes I just pushed out into:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/urgent
>
> namely: d6e152d905bd ("clockevents: Prevent timer interrupt starvation")

Hah, funny timing. I can confirm that the following diff against the
version in -next appears to fix the issue for me. Thanks for the quick
response!

Cheers,
Nathan

diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index f63c65881364..7e57fa31ee26 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -76,8 +76,10 @@ const struct clock_event_device *tick_get_wakeup_device(int cpu)
*/
static void tick_broadcast_start_periodic(struct clock_event_device *bc)
{
- if (bc)
+ if (bc) {
+ bc->next_event_forced = 0;
tick_setup_periodic(bc, 1);
+ }
}

/*
@@ -403,6 +405,7 @@ static void tick_handle_periodic_broadcast(struct clock_event_device *dev)
bool bc_local;

raw_spin_lock(&tick_broadcast_lock);
+ tick_broadcast_device.evtdev->next_event_forced = 0;

/* Handle spurious interrupts gracefully */
if (clockevent_state_shutdown(tick_broadcast_device.evtdev)) {
@@ -696,6 +699,7 @@ static void tick_handle_oneshot_broadcast(struct clock_event_device *dev)

raw_spin_lock(&tick_broadcast_lock);
dev->next_event = KTIME_MAX;
+ tick_broadcast_device.evtdev->next_event_forced = 0;
next_event = KTIME_MAX;
cpumask_clear(tmpmask);
now = ktime_get();
@@ -1063,6 +1067,7 @@ static void tick_broadcast_setup_oneshot(struct clock_event_device *bc,


bc->event_handler = tick_handle_oneshot_broadcast;
+ bc->next_event_forced = 0;
bc->next_event = KTIME_MAX;

/*
@@ -1175,6 +1180,7 @@ void hotplug_cpu__broadcast_tick_pull(int deadcpu)
}

/* This moves the broadcast assignment to this CPU: */
+ bc->next_event_forced = 0;
clockevents_program_event(bc, bc->next_event, 1);
}
raw_spin_unlock_irqrestore(&tick_broadcast_lock, flags);