Commit b726b7df authored by Mel Gorman's avatar Mel Gorman Committed by Ingo Molnar

Revert "mm: sched: numa: Delay PTE scanning until a task is scheduled on a new node"

PTE scanning and NUMA hinting fault handling is expensive so commit
5bca2303 ("mm: sched: numa: Delay PTE scanning until a task is scheduled
on a new node") deferred the PTE scan until a task had been scheduled on
another node. The problem is that in the purely shared memory case that
this may never happen and no NUMA hinting fault information will be
captured. We are not ruling out the possibility that something better
can be done here but for now, this patch needs to be reverted and depend
entirely on the scan_delay to avoid punishing short-lived processes.
Signed-off-by: default avatarMel Gorman <mgorman@suse.de>
Reviewed-by: default avatarRik van Riel <riel@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1381141781-10992-16-git-send-email-mgorman@suse.deSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 9e645ab6
...@@ -428,20 +428,10 @@ struct mm_struct { ...@@ -428,20 +428,10 @@ struct mm_struct {
/* numa_scan_seq prevents two threads setting pte_numa */ /* numa_scan_seq prevents two threads setting pte_numa */
int numa_scan_seq; int numa_scan_seq;
/*
* The first node a task was scheduled on. If a task runs on
* a different node than Make PTE Scan Go Now.
*/
int first_nid;
#endif #endif
struct uprobes_state uprobes_state; struct uprobes_state uprobes_state;
}; };
/* first nid will either be a valid NID or one of these values */
#define NUMA_PTE_SCAN_INIT -1
#define NUMA_PTE_SCAN_ACTIVE -2
static inline void mm_init_cpumask(struct mm_struct *mm) static inline void mm_init_cpumask(struct mm_struct *mm)
{ {
#ifdef CONFIG_CPUMASK_OFFSTACK #ifdef CONFIG_CPUMASK_OFFSTACK
......
...@@ -816,9 +816,6 @@ struct mm_struct *dup_mm(struct task_struct *tsk) ...@@ -816,9 +816,6 @@ struct mm_struct *dup_mm(struct task_struct *tsk)
#ifdef CONFIG_TRANSPARENT_HUGEPAGE #ifdef CONFIG_TRANSPARENT_HUGEPAGE
mm->pmd_huge_pte = NULL; mm->pmd_huge_pte = NULL;
#endif
#ifdef CONFIG_NUMA_BALANCING
mm->first_nid = NUMA_PTE_SCAN_INIT;
#endif #endif
if (!mm_init(mm, tsk)) if (!mm_init(mm, tsk))
goto fail_nomem; goto fail_nomem;
......
...@@ -900,24 +900,6 @@ void task_numa_work(struct callback_head *work) ...@@ -900,24 +900,6 @@ void task_numa_work(struct callback_head *work)
if (p->flags & PF_EXITING) if (p->flags & PF_EXITING)
return; return;
/*
* We do not care about task placement until a task runs on a node
* other than the first one used by the address space. This is
* largely because migrations are driven by what CPU the task
* is running on. If it's never scheduled on another node, it'll
* not migrate so why bother trapping the fault.
*/
if (mm->first_nid == NUMA_PTE_SCAN_INIT)
mm->first_nid = numa_node_id();
if (mm->first_nid != NUMA_PTE_SCAN_ACTIVE) {
/* Are we running on a new node yet? */
if (numa_node_id() == mm->first_nid &&
!sched_feat_numa(NUMA_FORCE))
return;
mm->first_nid = NUMA_PTE_SCAN_ACTIVE;
}
/* /*
* Reset the scan period if enough time has gone by. Objective is that * Reset the scan period if enough time has gone by. Objective is that
* scanning will be reduced if pages are properly placed. As tasks * scanning will be reduced if pages are properly placed. As tasks
......
...@@ -63,10 +63,8 @@ SCHED_FEAT(LB_MIN, false) ...@@ -63,10 +63,8 @@ SCHED_FEAT(LB_MIN, false)
/* /*
* Apply the automatic NUMA scheduling policy. Enabled automatically * Apply the automatic NUMA scheduling policy. Enabled automatically
* at runtime if running on a NUMA machine. Can be controlled via * at runtime if running on a NUMA machine. Can be controlled via
* numa_balancing=. Allow PTE scanning to be forced on UMA machines * numa_balancing=
* for debugging the core machinery.
*/ */
#ifdef CONFIG_NUMA_BALANCING #ifdef CONFIG_NUMA_BALANCING
SCHED_FEAT(NUMA, false) SCHED_FEAT(NUMA, false)
SCHED_FEAT(NUMA_FORCE, false)
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment