sched/numa: Allow a floating imbalance between NUMA nodes
authorMel Gorman <mgorman@techsingularity.net>
Fri, 20 Nov 2020 09:06:29 +0000 (09:06 +0000)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 24 Nov 2020 15:47:47 +0000 (16:47 +0100)
commit7d2b5dd0bcc48095651f1b85f751eef610b3e034
tree3ba4db0b20608f0906c66bdcd96c22254677f5de
parent5c339005f854fa75aa46078ad640919425658b3e
sched/numa: Allow a floating imbalance between NUMA nodes

Currently, an imbalance is only allowed when a destination node
is almost completely idle. This solved one basic class of problems
and was the cautious approach.

This patch revisits the possibility that NUMA nodes can be imbalanced
until 25% of the CPUs are occupied. The reasoning behind 25% is somewhat
superficial -- it's half the cores when HT is enabled.  At higher
utilisations, balancing should continue as normal and keep things even
until scheduler domains are fully busy or over utilised.

Note that this is not expected to be a universal win. Any benchmark
that prefers spreading as wide as possible with limited communication
will favour the old behaviour as there is more memory bandwidth.
Workloads that communicate heavily in pairs such as netperf or tbench
benefit. For the tests I ran, the vast majority of workloads saw
a benefit so it seems to be a worthwhile trade-off.

Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lkml.kernel.org/r/20201120090630.3286-4-mgorman@techsingularity.net
kernel/sched/fair.c