From: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>
To: Christian Loehle <christian.loehle@arm.com>,
Maulik Shah <maulik.shah@oss.qualcomm.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Daniel Lezcano <daniel.lezcano@kernel.org>,
Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH] cpuidle: Deny idle entry when CPU already have IPI interrupt pending
Date: Mon, 16 Mar 2026 11:51:38 +0100 [thread overview]
Message-ID: <00a7ea43-e527-47f3-bcd4-285b7ba37a2e@oss.qualcomm.com> (raw)
In-Reply-To: <3d56b0db-7ece-48f7-ba59-fb1679aee804@arm.com>
On 3/16/26 10:50, Christian Loehle wrote:
[ ... ]
>>> So we already do a per-CPU IPI need_resched() check in the idle
>>> path.
>>
>> The need_resched() is not the same check. Here the interrupts are
>> off, the test check if there is a pending IPI before entering the
>> sleep routine which will in any case abort because of it. This
>> check saves the costs related to preparing entering the idle
>> state, the call to the firmware and the rollback. Those add an
>> overhead in terms of latency and energy for nothing. As stated in
>> the description, this ultimate check before going idle was
>> introduced also for the cluster idle state and showed a
>> significant improvement [1].
>>
>> [1] https://lore.kernel.org/all/20251105095415.17269-1-
>> ulf.hansson@linaro.org/
> So I didn't mean this as "it's unnecessary", but it did make me
> question how big the "performance" impact of this really is, in
> particular for per-CPU idle states (i.e. at most sleep / powerdown
> for you?)
From a per CPU perspective, it is hard to say. It really depends on the
workload, the number of CPUs and the correctness of the governor prediction.
I would say the higher the number of CPUs, the higher the probability to
receive an IPI, the lesser the accuracy of the governor [1] and the more
visible the improvement of this change is.
Maulik did some benchmarking with glmark2 and showed an improvement.
> But if this is only about cluster states (The original
> patch wasn't really clear on that?) then one issue is that the non-
> pmdomain case (e.g. psci PC-mode) we don't actually know what a
> cluster is and therefore which CPUs to check for pending IPIs,
> right?
Ulf changes is for platforms, usually Snapdragon, where the kernel has a
knowledge of the topology and uses the PSCI-OSI (IIRC). So the kernel is
in charge of the last-man-standing for the group of CPUs belonging to
the same cluster. It has all the needed information for this specific
configuration.
In the case of the PSCI-PC, the firmware is in charge of the cluster
idling and AFAICT it does a test for pending IRQ / IPI.
-- Daniel
[1] IPI prediction is not possible because it fully depends on the
scheduler, so on the behavior of the tasks.
next prev parent reply other threads:[~2026-03-16 10:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-16 7:37 [PATCH] cpuidle: Deny idle entry when CPU already have IPI interrupt pending Maulik Shah
2026-03-16 8:55 ` Christian Loehle
2026-03-16 9:21 ` Maulik Shah (mkshah)
2026-03-16 9:32 ` Daniel Lezcano
2026-03-16 9:50 ` Christian Loehle
2026-03-16 10:51 ` Daniel Lezcano [this message]
2026-03-20 18:29 ` Rafael J. Wysocki
2026-03-23 12:13 ` Maulik Shah (mkshah)
2026-03-24 16:07 ` Rafael J. Wysocki
2026-03-25 5:37 ` Maulik Shah (mkshah)
2026-03-24 15:46 ` Ulf Hansson
2026-03-25 15:34 ` Maulik Shah (mkshah)
2026-04-03 8:45 ` kernel test robot
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=00a7ea43-e527-47f3-bcd4-285b7ba37a2e@oss.qualcomm.com \
--to=daniel.lezcano@oss.qualcomm.com \
--cc=christian.loehle@arm.com \
--cc=daniel.lezcano@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=maulik.shah@oss.qualcomm.com \
--cc=rafael@kernel.org \
--cc=ulf.hansson@linaro.org \
/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.