Re: [PATCH] sched_ext: improve WAKE_SYNC behavior for default idle CPU selection

From: Andrea Righi
Date: Fri Oct 18 2024 - 13:58:43 EST


On Fri, Oct 18, 2024 at 07:38:10AM -1000, Tejun Heo wrote:
> Hello,
>
> On Fri, Oct 18, 2024 at 11:40:33AM +0200, Andrea Righi wrote:
> ...
> > + * If WAKE_SYNC, try to migrate the wakee to the waker's CPU.
> > + */
> > + if (wake_flags & SCX_WAKE_SYNC) {
> > + cpu = smp_processor_id();
> > +
> > + /*
> > + * If the waker's CPU is cache affine and prev_cpu is idle,
> > + * then avoid a migration.
> > + */
> > + if (cpus_share_cache(cpu, prev_cpu) &&
> > + test_and_clear_cpu_idle(prev_cpu))
> > goto cpu_found;
>
> Shouldn't this do set cpu to prev_cpu before jumping to cpu_found?

Ah! You're absolutely right!

Let me send a v2 (and test it).

Thanks,
-Andrea

>
> Thanks.
>
> --
> tejun