Re: [PATCH 4/4] sched/numa: Do not move imbalanced load purely on the basis of an idle CPU
From: Srikar Dronamraju
Date: Wed Sep 12 2018 - 06:45:16 EST
* Peter Zijlstra <peterz@xxxxxxxxxxxxx> [2018-09-12 11:36:21]:
> On Wed, Sep 12, 2018 at 12:24:10PM +0530, Srikar Dronamraju wrote:
>
> > Kernel A = 4.18+ 13 sched patches part of v4.19-rc1.
> > Kernel B = Kernel A + 6 patches (http://lore.kernel.org/lkml/1533276841-16341-1-git-send-email-srikar@xxxxxxxxxxxxxxxxxx)
> > Kernel C = Kernel B - (Avoid task migration for small numa improvement) i.e
> > http://lore.kernel.org/lkml/1533276841-16341-4-git-send-email-srikar@xxxxxxxxxxxxxxxxxx
> > + 2 patches from Mel
> > (Do not move imbalanced load purely)
> > http://lore.kernel.org/lkml/20180907101139.20760-5-mgorman@xxxxxxxxxxxxxxxxxxx
> > (Stop comparing tasks for NUMA placement)
> > http://lore.kernel.org/lkml/20180907101139.20760-4-mgorman@xxxxxxxxxxxxxxxxxxx
>
> But that's not a fair comparison :/ You've complicated things by adding
> that second patch from Mel.
>
One patch does choose a idle thread over a possible swap. This is the one
that conflicts with "Avoid task migration for small numa improvement".
The other one detects if we have already found an idle thread and stops
iterating. So if we have already chosen a idle CPU, then dont iterate. So
this patch should ideally help the above patch.
My take on both the patches:
If there is a possible swap candidate (i.e if choosing a thread over idle is
better from a NUMA score improvement perspective), then it means the swap
candidate will benefit from movement. It means the swap candidate is not
running on its preferred node at this moment. If we don't do it, the swap
candidate will later on try migrating to its preferred node. We could avoid
that if we choose swap candidate over idle thread. Please note if the idle
and swap candidates yield the same NUMA score, then we still choose the idle
thread and not the swap candidate.
> Now you cannot (unambiguously) tell what the cause for the performance
> difference is.
>
The difference as I listed above is should we choose a swap candidate with
more NUMA score compared to idle thread.
My patch would hurt if there was an idle thread and we still iterate for
possible swap candidates and we dont find any. But that we cant speculate.