diff options
author | Rik van Riel <riel@redhat.com> | 2013-10-07 06:29:34 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-10-09 08:48:12 -0400 |
commit | dabe1d992414a6456e60e41f1d1ad8affc6d444d (patch) | |
tree | 213b65fbc7864687d0ea9db96d7e768b6ff587cf /mm | |
parent | 0ec8aa00f2b4dc457836ef4e2662b02483e94fb7 (diff) |
sched/numa: Be more careful about joining numa groups
Due to the way the pid is truncated, and tasks are moved between
CPUs by the scheduler, it is possible for the current task_numa_fault
to group together tasks that do not actually share memory together.
This patch adds a few easy sanity checks to task_numa_fault, joining
tasks together if they share the same tsk->mm, or if the fault was on
a page with an elevated mapcount, in a shared VMA.
Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Mel Gorman <mgorman@suse.de>
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-57-git-send-email-mgorman@suse.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memory.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mm/memory.c b/mm/memory.c index 9898eeb9a21c..823720c43ea9 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -3584,6 +3584,13 @@ int do_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
3584 | if (!pte_write(pte)) | 3584 | if (!pte_write(pte)) |
3585 | flags |= TNF_NO_GROUP; | 3585 | flags |= TNF_NO_GROUP; |
3586 | 3586 | ||
3587 | /* | ||
3588 | * Flag if the page is shared between multiple address spaces. This | ||
3589 | * is later used when determining whether to group tasks together | ||
3590 | */ | ||
3591 | if (page_mapcount(page) > 1 && (vma->vm_flags & VM_SHARED)) | ||
3592 | flags |= TNF_SHARED; | ||
3593 | |||
3587 | last_cpupid = page_cpupid_last(page); | 3594 | last_cpupid = page_cpupid_last(page); |
3588 | page_nid = page_to_nid(page); | 3595 | page_nid = page_to_nid(page); |
3589 | target_nid = numa_migrate_prep(page, vma, addr, page_nid); | 3596 | target_nid = numa_migrate_prep(page, vma, addr, page_nid); |