diff options
author | Kirill A. Shutemov <kirill.shutemov@linux.intel.com> | 2016-03-17 17:19:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-17 18:09:34 -0400 |
commit | 3ed3a4f0ddffece942bb2661924d87be4ce63cb7 (patch) | |
tree | 3b47bba0ba26a0301339f4989a57346e0f76b989 /mm/mremap.c | |
parent | 5057dcd0f1aaad57e07e728ba20a99e205c6b9de (diff) |
mm: cleanup *pte_alloc* interfaces
There are few things about *pte_alloc*() helpers worth cleaning up:
- 'vma' argument is unused, let's drop it;
- most __pte_alloc() callers do speculative check for pmd_none(),
before taking ptl: let's introduce pte_alloc() macro which does
the check.
The only direct user of __pte_alloc left is userfaultfd, which has
different expectation about atomicity wrt pmd.
- pte_alloc_map() and pte_alloc_map_lock() are redefined using
pte_alloc().
[sudeep.holla@arm.com: fix build for arm64 hugetlbpage]
[sfr@canb.auug.org.au: fix arch/arm/mm/mmu.c some more]
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/mremap.c')
-rw-r--r-- | mm/mremap.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/mremap.c b/mm/mremap.c index e30c8a6489a6..3fa0a467df66 100644 --- a/mm/mremap.c +++ b/mm/mremap.c | |||
@@ -213,8 +213,7 @@ unsigned long move_page_tables(struct vm_area_struct *vma, | |||
213 | continue; | 213 | continue; |
214 | VM_BUG_ON(pmd_trans_huge(*old_pmd)); | 214 | VM_BUG_ON(pmd_trans_huge(*old_pmd)); |
215 | } | 215 | } |
216 | if (pmd_none(*new_pmd) && __pte_alloc(new_vma->vm_mm, new_vma, | 216 | if (pte_alloc(new_vma->vm_mm, new_pmd, new_addr)) |
217 | new_pmd, new_addr)) | ||
218 | break; | 217 | break; |
219 | next = (new_addr + PMD_SIZE) & PMD_MASK; | 218 | next = (new_addr + PMD_SIZE) & PMD_MASK; |
220 | if (extent > next - new_addr) | 219 | if (extent > next - new_addr) |