diff options
author | Dan Williams <dan.j.williams@intel.com> | 2016-01-15 19:56:52 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-15 20:56:32 -0500 |
commit | 5c7fb56e5e3f7035dd798a8e1adee639f87043e5 (patch) | |
tree | e3419de32c4b42c918267a50120549cbec2ed63f /mm/mprotect.c | |
parent | 5c2c2587b13235bf8b5c9027589f22eff68bdf49 (diff) |
mm, dax: dax-pmd vs thp-pmd vs hugetlbfs-pmd
A dax-huge-page mapping while it uses some thp helpers is ultimately not
a transparent huge page. The distinction is especially important in the
get_user_pages() path. pmd_devmap() is used to distinguish dax-pmds
from pmd_huge() and pmd_trans_huge() which have slightly different
semantics.
Explicitly mark the pmd_trans_huge() helpers that dax needs by adding
pmd_devmap() checks.
[kirill.shutemov@linux.intel.com: fix regression in handling mlocked pages in __split_huge_pmd()]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Cc: Dave Hansen <dave@sr71.net>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/mprotect.c')
-rw-r--r-- | mm/mprotect.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/mprotect.c b/mm/mprotect.c index 6047707085c1..8eb7bb40dc40 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c | |||
@@ -149,7 +149,8 @@ static inline unsigned long change_pmd_range(struct vm_area_struct *vma, | |||
149 | unsigned long this_pages; | 149 | unsigned long this_pages; |
150 | 150 | ||
151 | next = pmd_addr_end(addr, end); | 151 | next = pmd_addr_end(addr, end); |
152 | if (!pmd_trans_huge(*pmd) && pmd_none_or_clear_bad(pmd)) | 152 | if (!pmd_trans_huge(*pmd) && !pmd_devmap(*pmd) |
153 | && pmd_none_or_clear_bad(pmd)) | ||
153 | continue; | 154 | continue; |
154 | 155 | ||
155 | /* invoke the mmu notifier if the pmd is populated */ | 156 | /* invoke the mmu notifier if the pmd is populated */ |
@@ -158,7 +159,7 @@ static inline unsigned long change_pmd_range(struct vm_area_struct *vma, | |||
158 | mmu_notifier_invalidate_range_start(mm, mni_start, end); | 159 | mmu_notifier_invalidate_range_start(mm, mni_start, end); |
159 | } | 160 | } |
160 | 161 | ||
161 | if (pmd_trans_huge(*pmd)) { | 162 | if (pmd_trans_huge(*pmd) || pmd_devmap(*pmd)) { |
162 | if (next - addr != HPAGE_PMD_SIZE) | 163 | if (next - addr != HPAGE_PMD_SIZE) |
163 | split_huge_pmd(vma, pmd, addr); | 164 | split_huge_pmd(vma, pmd, addr); |
164 | else { | 165 | else { |