mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Frederic Weisbecker <frederic@kernel.org>
Cc: Radu Toader <radu.m.toader@gmail.com>,
	mingo@redhat.com, tglx@kernel.org, tglx@linutronix.de,
	tj@kernel.org, juri.lelli@redhat.com, vincent.guittot@linaro.org,
	dietmar.eggemann@arm.com, rostedt@goodmis.org,
	bsegall@google.com, mgorman@suse.de, vschneid@redhat.com,
	kprateek.nayak@amd.com, void@manifault.com, arighi@nvidia.com,
	changwoo@igalia.com, anna-maria@linutronix.de,
	bigeasy@linutronix.de, joshdon@google.com, haoluo@google.com,
	brho@google.com, boqun@kernel.org, joelagnelf@nvidia.com,
	enlin.mu@linux.dev, brads@mainlining.org, kmehltretter@gmail.com,
	sched-ext@lists.linux.dev, bpf@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] softirq: Treat an interrupted idle task as idle in tick_irq_exit()
Date: Wed, 11 Nov 2026 17:56:40 +0100	[thread overview]
Message-ID: <20261111165640.GQ1779021@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <avSTjihu0YXfFNUV@localhost.localdomain>

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@kernel.org>

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.

  reply	other threads:[~2026-11-11 16:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11 11:29 Radu Toader
2026-11-11 16:10 ` Frederic Weisbecker
2026-11-11 16:56   ` Peter Zijlstra [this message]
2026-11-11 16:31 Bradley Morgan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261111165640.GQ1779021@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=anna-maria@linutronix.de \
    --cc=arighi@nvidia.com \
    --cc=bigeasy@linutronix.de \
    --cc=boqun@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=brads@mainlining.org \
    --cc=brho@google.com \
    --cc=bsegall@google.com \
    --cc=changwoo@igalia.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=enlin.mu@linux.dev \
    --cc=frederic@kernel.org \
    --cc=haoluo@google.com \
    --cc=joelagnelf@nvidia.com \
    --cc=joshdon@google.com \
    --cc=juri.lelli@redhat.com \
    --cc=kmehltretter@gmail.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=radu.m.toader@gmail.com \
    --cc=rostedt@goodmis.org \
    --cc=sched-ext@lists.linux.dev \
    --cc=tglx@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=void@manifault.com \
    --cc=vschneid@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®