]> Git Repo - linux.git/commit
sched/numa: Prefer using an idle CPU as a migration target instead of comparing tasks
authorMel Gorman <[email protected]>
Mon, 24 Feb 2020 09:52:20 +0000 (09:52 +0000)
committerIngo Molnar <[email protected]>
Mon, 24 Feb 2020 10:36:38 +0000 (11:36 +0100)
commitff7db0bf24db919f69121bf5df8f3cb6d79f49af
treedadf720f3de44d14aa5aa1249c3c3b9c4788b097
parent070f5e860ee2bf588c99ef7b4c202451faa48236
sched/numa: Prefer using an idle CPU as a migration target instead of comparing tasks

task_numa_find_cpu() can scan a node multiple times. Minimally it scans to
gather statistics and later to find a suitable target. In some cases, the
second scan will simply pick an idle CPU if the load is not imbalanced.

This patch caches information on an idle core while gathering statistics
and uses it immediately if load is not imbalanced to avoid a second scan
of the node runqueues. Preference is given to an idle core rather than an
idle SMT sibling to avoid packing HT siblings due to linearly scanning the
node cpumask.

As a side-effect, even when the second scan is necessary, the importance
of using select_idle_sibling is much reduced because information on idle
CPUs is cached and can be reused.

Note that this patch actually makes is harder to move to an idle CPU
as multiple tasks can race for the same idle CPU due to a race checking
numa_migrate_on. This is addressed in the next patch.

Signed-off-by: Mel Gorman <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Acked-by: Peter Zijlstra <[email protected]>
Cc: Vincent Guittot <[email protected]>
Cc: Juri Lelli <[email protected]>
Cc: Dietmar Eggemann <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Valentin Schneider <[email protected]>
Cc: Phil Auld <[email protected]>
Cc: Hillf Danton <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
kernel/sched/fair.c
This page took 0.055724 seconds and 4 git commands to generate.