sched/numa: Apply imbalance limitations consistently
authorMel Gorman <mgorman@techsingularity.net>
Fri, 20 May 2022 10:35:18 +0000 (11:35 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 13 Jun 2022 08:29:59 +0000 (10:29 +0200)
commitcb29a5c19d2d68afc641fb1949e1a1c565b582ea
tree947d47688097dfa46b9956fb84442630b1f53f13
parent13ede33150877d44756171e33570076882b17b0b
sched/numa: Apply imbalance limitations consistently

The imbalance limitations are applied inconsistently at fork time
and at runtime. At fork, a new task can remain local until there are
too many running tasks even if the degree of imbalance is larger than
NUMA_IMBALANCE_MIN which is different to runtime. Secondly, the imbalance
figure used during load balancing is different to the one used at NUMA
placement. Load balancing uses the number of tasks that must move to
restore imbalance where as NUMA balancing uses the total imbalance.

In combination, it is possible for a parallel workload that uses a small
number of CPUs without applying scheduler policies to have very variable
run-to-run performance.

[lkp@intel.com: Fix build breakage for arc-allyesconfig]

Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: K Prateek Nayak <kprateek.nayak@amd.com>
Link: https://lore.kernel.org/r/20220520103519.1863-4-mgorman@techsingularity.net
kernel/sched/fair.c