Skip to content

Commit b726b7d

Browse files
Mel Gormaningomolnar
authored andcommitted
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 5bca230 ("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: Mel Gorman <mgorman@suse.de> Reviewed-by: Rik 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: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1381141781-10992-16-git-send-email-mgorman@suse.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 9e645ab commit b726b7d

4 files changed

Lines changed: 1 addition & 34 deletions

File tree

‎include/linux/mm_types.h‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -428,20 +428,10 @@ struct mm_struct {
428428

429429
/* numa_scan_seq prevents two threads setting pte_numa */
430430
int numa_scan_seq;
431-
432-
/*
433-
* The first node a task was scheduled on. If a task runs on
434-
* a different node than Make PTE Scan Go Now.
435-
*/
436-
int first_nid;
437431
#endif
438432
struct uprobes_state uprobes_state;
439433
};
440434

441-
/* first nid will either be a valid NID or one of these values */
442-
#define NUMA_PTE_SCAN_INIT -1
443-
#define NUMA_PTE_SCAN_ACTIVE -2
444-
445435
static inline void mm_init_cpumask(struct mm_struct *mm)
446436
{
447437
#ifdef CONFIG_CPUMASK_OFFSTACK

‎kernel/fork.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -816,9 +816,6 @@ struct mm_struct *dup_mm(struct task_struct *tsk)
816816

817817
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
818818
mm->pmd_huge_pte = NULL;
819-
#endif
820-
#ifdef CONFIG_NUMA_BALANCING
821-
mm->first_nid = NUMA_PTE_SCAN_INIT;
822819
#endif
823820
if (!mm_init(mm, tsk))
824821
goto fail_nomem;

‎kernel/sched/fair.c‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -900,24 +900,6 @@ void task_numa_work(struct callback_head *work)
900900
if (p->flags & PF_EXITING)
901901
return;
902902

903-
/*
904-
* We do not care about task placement until a task runs on a node
905-
* other than the first one used by the address space. This is
906-
* largely because migrations are driven by what CPU the task
907-
* is running on. If it's never scheduled on another node, it'll
908-
* not migrate so why bother trapping the fault.
909-
*/
910-
if (mm->first_nid == NUMA_PTE_SCAN_INIT)
911-
mm->first_nid = numa_node_id();
912-
if (mm->first_nid != NUMA_PTE_SCAN_ACTIVE) {
913-
/* Are we running on a new node yet? */
914-
if (numa_node_id() == mm->first_nid &&
915-
!sched_feat_numa(NUMA_FORCE))
916-
return;
917-
918-
mm->first_nid = NUMA_PTE_SCAN_ACTIVE;
919-
}
920-
921903
/*
922904
* Reset the scan period if enough time has gone by. Objective is that
923905
* scanning will be reduced if pages are properly placed. As tasks

‎kernel/sched/features.h‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,8 @@ SCHED_FEAT(LB_MIN, false)
6363
/*
6464
* Apply the automatic NUMA scheduling policy. Enabled automatically
6565
* at runtime if running on a NUMA machine. Can be controlled via
66-
* numa_balancing=. Allow PTE scanning to be forced on UMA machines
67-
* for debugging the core machinery.
66+
* numa_balancing=
6867
*/
6968
#ifdef CONFIG_NUMA_BALANCING
7069
SCHED_FEAT(NUMA, false)
71-
SCHED_FEAT(NUMA_FORCE, false)
7270
#endif

0 commit comments

Comments
 (0)