From: Radu Toader <radu.m.toader@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: mingo@redhat.com, tj@kernel.org, tglx@kernel.org,
frederic@kernel.org, anna-maria@linutronix.de,
bigeasy@linutronix.de, 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,
linux-kernel@vger.kernel.org, sched-ext@lists.linux.dev,
bpf@vger.kernel.org
Subject: Re: [PATCH 2/2] softirq: Treat an interrupted idle task as idle in tick_irq_exit()
Date: Sat, 7 Nov 2026 02:15:07 +0000 [thread overview]
Message-ID: <20261107021509.968928-2-radu.m.toader@gmail.com> (raw)
In-Reply-To: <20261106102315.GT1813469@noisy.programming.kicks-ass.net>
On Fri, Nov 06, 2026 at 11:23:15AM +0100, Peter Zijlstra wrote:
> So is_idle_task() is also true for idle-injection tasks. I *think* that
> is also right in this case, but it wasn't mentioned.
>
> That is, we can have tasks that are not rq->idle for which
> is_idle_task()/PF_IDLE is true, those tasks will also 'run' an idle
> state, see play_idle_precise() and its users.
You are right on both counts, and it should have been mentioned. v2
names it.
I agree it is also right here, for the same reason the idle task needs
it: during injection the CPU does run an idle state. play_idle_precise()
sets PF_IDLE and loops on do_idle(), so TS_FLAG_INIDLE is set and
tick_nohz_irq_exit() has exactly the work to do there that it has for
the idle task. What it is not is confined to sched_ext - it reaches the
idle_inject() users, intel_powerclamp and cpuidle_cooling - and v2 says
so rather than leaving that for a reviewer to find.
Writing it up also showed that my claim the new gate is "strictly wider"
than the old one is wrong, so it is gone. PF_IDLE is set by
cpu_startup_entry() and not by init_idle(), so a CPU on its idle task
before that point satisfies idle_cpu() but not is_idle_task(current).
Nothing is lost there, since TS_FLAG_INIDLE is only set inside do_idle()
and so tick_nohz_irq_exit() had nothing to do, and nohz_full CPUs are
covered by tick_nohz_full_cpu(cpu) either way. But the gates overlap
rather than one containing the other, and v2 states that instead.
Patch 1 is dropped from v2 at Tejun's request; the reproducer stays in
the archive and the fix links to it.
Disclosure: this reply was written by Claude Opus 5 (Claude Code) and
sent on my behalf, in the same session as the patch; the patch changelog
carries the same note.
next prev parent reply other threads:[~2026-11-07 2:15 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 9:43 [PATCH 0/2] softirq: fix idle accounting for an interrupted idle task Radu Toader
2026-11-06 9:43 ` [PATCH 1/2] sched_ext: Add scx_tickbug, a scheduler that holds a task on an idle CPU Radu Toader
2026-11-06 10:15 ` sashiko-bot
2026-11-06 16:59 ` Tejun Heo
2026-11-07 2:15 ` Radu Toader
2026-11-06 20:10 ` bot+bpf-ci
2026-11-07 2:15 ` Radu Toader
2026-11-06 9:43 ` [PATCH 2/2] softirq: Treat an interrupted idle task as idle in tick_irq_exit() Radu Toader
2026-11-06 10:23 ` Peter Zijlstra
2026-11-07 2:15 ` Radu Toader [this message]
2026-11-06 19:55 ` bot+bpf-ci
2026-11-07 2:15 ` Radu Toader
-- strict thread matches above, loose matches on Subject: below --
2026-11-05 20:02 [PATCH 0/2] softirq: fix idle accounting for an interrupted idle task Radu Toader
2026-11-05 20:02 ` [PATCH 2/2] softirq: Treat an interrupted idle task as idle in tick_irq_exit() Radu Toader
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=20261107021509.968928-2-radu.m.toader@gmail.com \
--to=radu.m.toader@gmail.com \
--cc=anna-maria@linutronix.de \
--cc=bigeasy@linutronix.de \
--cc=bpf@vger.kernel.org \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=frederic@kernel.org \
--cc=juri.lelli@redhat.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=sched-ext@lists.linux.dev \
--cc=tglx@kernel.org \
--cc=tj@kernel.org \
--cc=vincent.guittot@linaro.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.