[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAPDyKFrVkO1nn-1C7z9RJBX-bzxQ8_tBhhKNaK7h++NbAoT3zg@mail.gmail.com>
Date: Mon, 20 Oct 2025 15:15:43 +0200
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Thomas Gleixner <tglx@...utronix.de>, Mark Rutland <mark.rutland@....com>,
Marc Zyngier <maz@...nel.org>
Cc: "Rafael J . Wysocki" <rafael@...nel.org>, Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>, 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
Subject: Re: [PATCH 2/3] arm64: smp: Implement cpus_has_pending_ipi()
+ Marc
On Fri, 17 Oct 2025 at 16:01, Thomas Gleixner <tglx@...utronix.de> wrote:
>
> 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?
Indeed this is way better, thanks for your suggestion!
I have also tried this out and can confirm that it gives the same
improved results on the Dragonboard 410c!
I will submit a new version of the series and I will try to
incorporate all the valuable feedback I have received.
Thanks everyone and kind regards
Uffe
Powered by blists - more mailing lists