diff options
author | Peter Zijlstra <peterz@infradead.org> | 2013-10-07 06:29:21 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-10-09 08:47:47 -0400 |
commit | 8c8a743c5087bac9caac8155b8f3b367e75cdd0b (patch) | |
tree | d5cc5c5f4368cf7d3deb627388c869dbea2e83f2 /mm/memory.c | |
parent | 90572890d202527c366aa9489b32404e88a7c020 (diff) |
sched/numa: Use {cpu, pid} to create task groups for shared faults
While parallel applications tend to align their data on the cache
boundary, they tend not to align on the page or THP boundary.
Consequently tasks that partition their data can still "false-share"
pages presenting a problem for optimal NUMA placement.
This patch uses NUMA hinting faults to chain tasks together into
numa_groups. As well as storing the NID a task was running on when
accessing a page a truncated representation of the faulting PID is
stored. If subsequent faults are from different PIDs it is reasonable
to assume that those two tasks share a page and are candidates for
being grouped together. Note that this patch makes no scheduling
decisions based on the grouping information.
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
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>
Link: http://lkml.kernel.org/r/1381141781-10992-44-git-send-email-mgorman@suse.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'mm/memory.c')
-rw-r--r-- | mm/memory.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mm/memory.c b/mm/memory.c index 5162e6d0d652..c57efa25cdbb 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -2719,6 +2719,14 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
2719 | get_page(dirty_page); | 2719 | get_page(dirty_page); |
2720 | 2720 | ||
2721 | reuse: | 2721 | reuse: |
2722 | /* | ||
2723 | * Clear the pages cpupid information as the existing | ||
2724 | * information potentially belongs to a now completely | ||
2725 | * unrelated process. | ||
2726 | */ | ||
2727 | if (old_page) | ||
2728 | page_cpupid_xchg_last(old_page, (1 << LAST_CPUPID_SHIFT) - 1); | ||
2729 | |||
2722 | flush_cache_page(vma, address, pte_pfn(orig_pte)); | 2730 | flush_cache_page(vma, address, pte_pfn(orig_pte)); |
2723 | entry = pte_mkyoung(orig_pte); | 2731 | entry = pte_mkyoung(orig_pte); |
2724 | entry = maybe_mkwrite(pte_mkdirty(entry), vma); | 2732 | entry = maybe_mkwrite(pte_mkdirty(entry), vma); |