Re: [GIT pull] timers/core for v7.1-rc1
From: Linus Torvalds
Date: Wed Apr 15 2026 - 01:37:04 EST
On Tue, 14 Apr 2026 at 22:01, Alexei Starovoitov
<alexei.starovoitov@xxxxxxxxx> wrote:
>
> and here is a fix mainly by claude with a lot of nudging
> from my side.
>
> Fixes the boot for me and looks correct.
So I think Claude isn't quite right in the explanation. Your patch
works, but I think it causes the double arming when preempting that
PeterZ tried to avoid.
Here's what I think I'll actually apply, generated literally as the
difference between my original merge and the final one that was
influenced by the state of linux-next.
And it's not the "irqs disabled" test that I think causes problems,
it's the "state.exit_rcu" one.
We should indeed only re-arm the deferred hrtimer if interrupts are
enabled, and that's what the code did when it was in
kernel/entry/common.c irqentry_exit().
But it should be re-armed regardless of that state.exit_rcu thing.
It would be lovely if you can still verify that yes, this version also
fixes things for you?
Linus
diff --git a/include/linux/irq-entry-common.h b/include/linux/irq-entry-common.h
index 7ab41eec549f..167fba7dbf04 100644
--- a/include/linux/irq-entry-common.h
+++ b/include/linux/irq-entry-common.h
@@ -474,8 +474,6 @@ static inline void irqentry_exit_to_kernel_mode_preempt(struct pt_regs *regs,
if (IS_ENABLED(CONFIG_PREEMPTION))
irqentry_exit_cond_resched();
-
- hrtimer_rearm_deferred();
}
/**
@@ -501,6 +499,7 @@ irqentry_exit_to_kernel_mode_after_preempt(struct pt_regs *regs, irqentry_state_
*/
if (state.exit_rcu) {
instrumentation_begin();
+ hrtimer_rearm_deferred();
/* Tell the tracer that IRET will enable interrupts */
trace_hardirqs_on_prepare();
lockdep_hardirqs_on_prepare();
@@ -511,6 +510,7 @@ irqentry_exit_to_kernel_mode_after_preempt(struct pt_regs *regs, irqentry_state_
}
instrumentation_begin();
+ hrtimer_rearm_deferred();
/* Covers both tracing and lockdep */
trace_hardirqs_on();
instrumentation_end();