[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251022080346.GH4067720@noisy.programming.kicks-ass.net>
Date: Wed, 22 Oct 2025 10:03:46 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Tejun Heo <tj@...nel.org>
Cc: David Vernet <void@...ifault.com>, Andrea Righi <arighi@...dia.com>,
Changwoo Min <changwoo@...lia.com>, linux-kernel@...r.kernel.org,
sched-ext@...ts.linux.dev, bpf@...r.kernel.org,
Wen-Fang Liu <liuwenfang@...or.com>
Subject: Re: sched_ext: Fix SCX_KICK_WAIT to work reliably
On Tue, Oct 21, 2025 at 11:03:54AM -1000, Tejun Heo wrote:
> @@ -5208,12 +5214,11 @@ static void kick_cpus_irq_workfn(struct
>
> if (cpu != cpu_of(this_rq)) {
> /*
> - * Pairs with smp_store_release() issued by this CPU in
> - * switch_class() on the resched path.
> + * Pairs with store_release in put_prev_task_scx().
> *
> - * We busy-wait here to guarantee that no other task can
> - * be scheduled on our core before the target CPU has
> - * entered the resched path.
> + * We busy-wait here to guarantee that the task running
> + * at the time of kicking is no longer running. This can
> + * be used to implement e.g. core scheduling.
> */
> while (smp_load_acquire(wait_pnt_seq) == pseqs[cpu])
> cpu_relax();
You could consider using:
smp_cond_load_acquire(wait_pnt_seq, VAL !+ pseqs[cpu]);
that's the fancy way of doing a spin wait and allows architectures to
optimize (mostly arm64 at this point).
Powered by blists - more mailing lists