diff options
Diffstat (limited to 'mm/mprotect.c')
-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); |