Skip to content

Commit

Permalink
sched/numa: Slow scan rate if no NUMA hinting faults are being recorded
Browse files Browse the repository at this point in the history
NUMA PTE scanning slows if a NUMA hinting fault was trapped and no page
was migrated. For long-lived but idle processes there may be no faults
but the scan rate will be high and just waste CPU. This patch will slow
the scan rate for processes that are not trapping faults.

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-19-git-send-email-mgorman@suse.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Mel Gorman authored and Ingo Molnar committed Oct 9, 2013
1 parent 598f0ec commit f307cd1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions kernel/sched/fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,18 @@ void task_numa_work(struct callback_head *work)
}

out:
/*
* If the whole process was scanned without updates then no NUMA
* hinting faults are being recorded and scan rate should be lower.
*/
if (mm->numa_scan_offset == 0 && !nr_pte_updates) {
p->numa_scan_period = min(p->numa_scan_period_max,
p->numa_scan_period << 1);

next_scan = now + msecs_to_jiffies(p->numa_scan_period);
mm->numa_next_scan = next_scan;
}

/*
* It is possible to reach the end of the VMA list but the last few
* VMAs are not guaranteed to the vma_migratable. If they are not, we
Expand Down

0 comments on commit f307cd1

Please sign in to comment.