Re: [PATCH] sched_ext: improve WAKE_SYNC behavior for default idle CPU selection
From: Tejun Heo
Date: Fri Oct 18 2024 - 13:40:57 EST
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?
Thanks.
--
tejun