[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aR365nLI26Ck6lkY@localhost.localdomain>
Date: Wed, 19 Nov 2025 18:14:14 +0100
From: Frederic Weisbecker <frederic@...nel.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Gabriele Monaco <gmonaco@...hat.com>, linux-kernel@...r.kernel.org,
Anna-Maria Behnsen <anna-maria@...utronix.de>,
Waiman Long <longman@...hat.com>,
"John B. Wyatt IV" <jwyatt@...hat.com>,
"John B. Wyatt IV" <sageofredondo@...il.com>
Subject: Re: [PATCH v15 7/7] timers: Exclude isolated cpus from timer
migration
Le Wed, Nov 19, 2025 at 05:50:15PM +0100, Thomas Gleixner a écrit :
> On Thu, Nov 13 2025 at 09:33, Gabriele Monaco wrote:
> > - cpumask_clear_cpu(cpu, tmigr_available_cpumask);
>
> By removing this the function name does not make any sense any
> more. Splitting the cpumask_clear_set() out, renaming the function
>
> > scoped_guard(raw_spinlock_irq, &tmc->lock) {
> > + if (!tmc->available)
> > + return 0;
>
> and adding this
>
> > tmc->available = false;
> > WRITE_ONCE(tmc->wakeup, KTIME_MAX);
> >
> > @@ -1453,11 +1485,11 @@ static int tmigr_clear_cpu_available(unsigned int cpu)
> > }
> >
> > if (firstexp != KTIME_MAX) {
> > - migrator = cpumask_any(tmigr_available_cpumask);
> > + migrator = cpumask_any_but(tmigr_available_cpumask, cpu);
>
> and this should be done in a preparatory patch along with a
> reasonable explanation in the change log.
>
> > work_on_cpu(migrator, tmigr_trigger_active, NULL);
> > }
> >
> > - return 0;
> > + return 1;
>
> But thinking more about it. What's the actual point of moving this 'clear'
> out instead of just moving it further down?
>
> It does not matter at all whether the isol/unisol muck clears an already
> cleared bit or not. But it would keep the function name comprehensible
> and avoid all this online/offline wrapper nonsense.
That was my suggestion.
It's because tmigr_clear_cpu_available() and tmigr_set_cpu_available()
can now all be called concurrently through the workqueues and race and
mess up the cpumask if they all try to clear/set at the same time...
And I couldn't find a saner way to order things...
Thanks.
--
Frederic Weisbecker
SUSE Labs
Powered by blists - more mailing lists