Re: [PATCH 16/19] sched/numa: Detect if node actively handling migration

Rik van Riel
2018-06-06T17:06:33Z

[-- Attachment #1: Type: text/plain, Size: 1289 bytes --]

On Wed, 2018-06-06 at 08:32 -0700, Srikar Dronamraju wrote:

> Yes its better to skip cpus if they are already in migration.
> And we are already doing it with the above patch. However as I said
> earlier
>
> - Task T1 sets Cpu 1 as best_cpu,
> - Task T2 finds cpu1 and skips Cpu1
> - Task T1 finds cpu2 slightly better than cpu1.
> - Task T1 resets cpu1 as best_cpu, sets best_cpu as cpu2.
> - Task T2 finds cpu2 and skips cpu2
> - Task T1 finds cpu3 as best_cpu slightly better than cpu2.
> - Task T1 resets cpu2 as best_cpu, sets best_cpu as cpu3.
> - Task T2 finds cpu3 and skips cpu3
>
> So after this T1 was able to find a cpu but T2 couldn't find a cpu
> even
> though there were 3 cpus that were available for 2 task to swap.
>
> Again, this is too corner case, that I am okay to drop.

Not only is that above race highly unlikely, it is also
still possible with your patch applied, if the scores
between cpu1, cpu2, and cpu3 differ by more than
SMALLIMP/2.

Not only is this patch some weird magic that makes the
code harder to maintain (since its purpose does not match
what the code actually does), but it also does not
reliably do what you intend it to do.

We may be better off not adding this bit of complexity.

--
All Rights Reversed.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]