diff options
author | Mel Gorman <mgorman@suse.de> | 2014-01-21 18:51:02 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-21 19:19:48 -0500 |
commit | 64a9a34e22896dad430e21a28ad8cb00a756fefc (patch) | |
tree | a2b61f7edff663bdf35d688ff160f3153c23fba4 /mm | |
parent | af1839d722c986ffeaae1e70a6ef1c75ff38dcd5 (diff) |
mm: numa: do not automatically migrate KSM pages
KSM pages can be shared between tasks that are not necessarily related
to each other from a NUMA perspective. This patch causes those pages to
be ignored by automatic NUMA balancing so they do not migrate and do not
cause unrelated tasks to be grouped together.
Signed-off-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Alex Thorlton <athorlton@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/mprotect.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/mprotect.c b/mm/mprotect.c index bb53a6591aea..7332c1785744 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/mmu_notifier.h> | 23 | #include <linux/mmu_notifier.h> |
24 | #include <linux/migrate.h> | 24 | #include <linux/migrate.h> |
25 | #include <linux/perf_event.h> | 25 | #include <linux/perf_event.h> |
26 | #include <linux/ksm.h> | ||
26 | #include <asm/uaccess.h> | 27 | #include <asm/uaccess.h> |
27 | #include <asm/pgtable.h> | 28 | #include <asm/pgtable.h> |
28 | #include <asm/cacheflush.h> | 29 | #include <asm/cacheflush.h> |
@@ -63,7 +64,7 @@ static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd, | |||
63 | 64 | ||
64 | ptent = *pte; | 65 | ptent = *pte; |
65 | page = vm_normal_page(vma, addr, oldpte); | 66 | page = vm_normal_page(vma, addr, oldpte); |
66 | if (page) { | 67 | if (page && !PageKsm(page)) { |
67 | if (!pte_numa(oldpte)) { | 68 | if (!pte_numa(oldpte)) { |
68 | ptent = pte_mknuma(ptent); | 69 | ptent = pte_mknuma(ptent); |
69 | set_pte_at(mm, addr, pte, ptent); | 70 | set_pte_at(mm, addr, pte, ptent); |