mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-17 17:24:17 +08:00
sched/numa: Always try to migrate to preferred node at task_numa_placement() time
It is possible that at task_numa_placement() time, the task's numa_preferred_nid does not change, but the task is not actually running on the preferred node at the time. In that case, we still want to attempt migration to the preferred node. Signed-off-by: Rik van Riel <riel@redhat.com> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: mgorman@suse.de Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: http://lkml.kernel.org/r/20140604163315.1dbc7b56@cuia.bos.redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
parent
a43455a1d5
commit
bb97fc3164
@ -1613,11 +1613,13 @@ static void task_numa_placement(struct task_struct *p)
|
||||
spin_unlock_irq(group_lock);
|
||||
}
|
||||
|
||||
/* Preferred node as the node with the most faults */
|
||||
if (max_faults && max_nid != p->numa_preferred_nid) {
|
||||
/* Update the preferred nid and migrate task if possible */
|
||||
sched_setnuma(p, max_nid);
|
||||
numa_migrate_preferred(p);
|
||||
if (max_faults) {
|
||||
/* Set the new preferred node */
|
||||
if (max_nid != p->numa_preferred_nid)
|
||||
sched_setnuma(p, max_nid);
|
||||
|
||||
if (task_node(p) != p->numa_preferred_nid)
|
||||
numa_migrate_preferred(p);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user