Re: [PATCH v3] softirq: Treat an interrupted idle task as idle in tick_irq_exit()

From: Peter Zijlstra

Date: Wed Nov 11 2026 - 11:59:13 EST


On Wed, Nov 11, 2026 at 05:10:54PM +0100, Frederic Weisbecker wrote:

> > diff --git a/kernel/softirq.c b/kernel/softirq.c
> > index 7fc2200392cd..e7d649c29c0c 100644
> > --- a/kernel/softirq.c
> > +++ b/kernel/softirq.c
> > @@ -738,8 +738,16 @@ static inline void tick_irq_exit(void)
> > #ifdef CONFIG_NO_HZ_COMMON
> > int cpu = smp_processor_id();
> >
> > - /* Make sure that timer wheel updates are propagated */
> > - if ((sched_core_idle_cpu(cpu) && !need_resched()) || tick_nohz_full_cpu(cpu)) {
> > + /*
> > + * Make sure that timer wheel updates are propagated. An interrupted
> > + * idle loop counts as idle even with runnable tasks queued on the
> > + * CPU: forced idle under core scheduling, and the tasks sched_ext
> > + * keeps on a CPU's run queue while its BPF scheduler holds them back.
> > + * idle_cpu() would skip the idle bookkeeping of tick_nohz_irq_exit()
> > + * for those, and with an unstable sched_clock the CPU's clock then
> > + * isn't resynchronized when it leaves the idle loop.
> > + */
> > + if ((is_idle_task(current) && !need_resched()) || tick_nohz_full_cpu(cpu)) {
> > if (hardirq_count() == HARDIRQ_OFFSET)
> > tick_nohz_irq_exit();
>
> Works for me, but Peter might find something I haven't.
>
> Acked-by: Frederic Weisbecker <frederic@xxxxxxxxxx>

I looked at the previous version and didn't spot anything more than a
case missed in the verbiage passed around as Changelog. I think I'll
queue this thing, its simple enough, ableit the changelog is a chore to
read.