|
|
@@ -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);
|
|
|
}
|
|
|
}
|
|
|
|