diff options
Diffstat (limited to 'kernel/sched/fair.c')
-rw-r--r-- | kernel/sched/fair.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 7a02a2082e95..3e18f611a5aa 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c | |||
@@ -861,6 +861,24 @@ void task_numa_work(struct callback_head *work) | |||
861 | return; | 861 | return; |
862 | 862 | ||
863 | /* | 863 | /* |
864 | * We do not care about task placement until a task runs on a node | ||
865 | * other than the first one used by the address space. This is | ||
866 | * largely because migrations are driven by what CPU the task | ||
867 | * is running on. If it's never scheduled on another node, it'll | ||
868 | * not migrate so why bother trapping the fault. | ||
869 | */ | ||
870 | if (mm->first_nid == NUMA_PTE_SCAN_INIT) | ||
871 | mm->first_nid = numa_node_id(); | ||
872 | if (mm->first_nid != NUMA_PTE_SCAN_ACTIVE) { | ||
873 | /* Are we running on a new node yet? */ | ||
874 | if (numa_node_id() == mm->first_nid && | ||
875 | !sched_feat_numa(NUMA_FORCE)) | ||
876 | return; | ||
877 | |||
878 | mm->first_nid = NUMA_PTE_SCAN_ACTIVE; | ||
879 | } | ||
880 | |||
881 | /* | ||
864 | * Reset the scan period if enough time has gone by. Objective is that | 882 | * Reset the scan period if enough time has gone by. Objective is that |
865 | * scanning will be reduced if pages are properly placed. As tasks | 883 | * scanning will be reduced if pages are properly placed. As tasks |
866 | * can enter different phases this needs to be re-examined. Lacking | 884 | * can enter different phases this needs to be re-examined. Lacking |