From: Peter Zijlstra <peterz@infradead.org>
To: Hui Su <sh_def@163.com>
Cc: mingo@redhat.com, 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
Subject: Re: [PATCH] sched/idle: Make forced polling state race-safe
Date: Fri, 16 Oct 2026 11:01:43 +0200 [thread overview]
Message-ID: <20261016090143.GR2009045@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20261015094211.4156055-1-sh_def@163.com>
On Thu, Oct 15, 2026 at 06:42:11PM +0900, Hui Su wrote:
> cpu_idle_poll_ctrl() maintains a global nesting count for forced idle
> polling. The count is updated with plain increments and decrements while
> idle CPUs read it without synchronization.
>
> Use an atomic counter to make the nesting count safe against concurrent
> updates and to make idle-side accesses race-free.
>
> The weak arch_cpu_idle() fallback also permanently switches the generic
> idle path to polling. Keep that state separate from the temporary
> request counter so a concurrent request cannot overwrite, or later
> release, the fallback state.
>
This is about cpu_idle_poll_ctr(), right? Is there any actual
concurrency on that thing? Afaict there is just init time twiddling
there.
next prev parent reply other threads:[~2026-10-16 9:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 9:42 Hui Su
2026-10-16 9:01 ` Peter Zijlstra [this message]
2026-10-17 3:35 ` Hui Su
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=20261016090143.GR2009045@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--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=rostedt@goodmis.org \
--cc=sh_def@163.com \
--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 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®