diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched/fair.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index ecea8d9f957c..051903f33eec 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c | |||
@@ -1301,7 +1301,16 @@ static int task_numa_migrate(struct task_struct *p) | |||
1301 | if (env.best_cpu == -1) | 1301 | if (env.best_cpu == -1) |
1302 | return -EAGAIN; | 1302 | return -EAGAIN; |
1303 | 1303 | ||
1304 | sched_setnuma(p, env.dst_nid); | 1304 | /* |
1305 | * If the task is part of a workload that spans multiple NUMA nodes, | ||
1306 | * and is migrating into one of the workload's active nodes, remember | ||
1307 | * this node as the task's preferred numa node, so the workload can | ||
1308 | * settle down. | ||
1309 | * A task that migrated to a second choice node will be better off | ||
1310 | * trying for a better one later. Do not set the preferred node here. | ||
1311 | */ | ||
1312 | if (p->numa_group && node_isset(env.dst_nid, p->numa_group->active_nodes)) | ||
1313 | sched_setnuma(p, env.dst_nid); | ||
1305 | 1314 | ||
1306 | /* | 1315 | /* |
1307 | * Reset the scan period if the task is being rescheduled on an | 1316 | * Reset the scan period if the task is being rescheduled on an |