[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87ms5pzkxa.ffs@tglx>
Date: Fri, 17 Oct 2025 16:01:53 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Ulf Hansson <ulf.hansson@...aro.org>, "Rafael J . Wysocki"
<rafael@...nel.org>, Catalin Marinas <catalin.marinas@....com>, Will
Deacon <will@...nel.org>, Mark Rutland <mark.rutland@....com>
Cc: Maulik Shah <quic_mkshah@...cinc.com>, Sudeep Holla
<sudeep.holla@....com>, Daniel Lezcano <daniel.lezcano@...aro.org>,
Vincent Guittot <vincent.guittot@...aro.org>, linux-pm@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org, Ulf
Hansson <ulf.hansson@...aro.org>
Subject: Re: [PATCH 2/3] arm64: smp: Implement cpus_has_pending_ipi()
On Fri, Oct 03 2025 at 17:02, Ulf Hansson wrote:
> Note, the implementation is intentionally lightweight and doesn't use
> any
By some definition of lightweight.
> static void smp_cross_call(const struct cpumask *target, unsigned int ipinr)
> {
> + unsigned int cpu;
> +
> + for_each_cpu(cpu, target)
> + per_cpu(pending_ipi, cpu) = true;
Iterating over a full cpumask on a big system is not necessarily
considered lightweight. And that comes on top of the loop in
smp_call_function_many_cond() plus the potential loop in
arm64_send_ipi()...
None of this is actually needed. If you want a lightweight racy check
whether there is an IPI en route to a set of CPUs then you can simply do
that in kernel/smp.c:
bool smp_pending_ipis_crystalball(mask)
{
for_each_cpu(cpu, mask) {
if (!llist_empty(per_cpu_ptr(&call_single_queue, cpu)))
return true;
}
return false;
}
No?
Thanks,
tglx
Powered by blists - more mailing lists