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 /arch/arm/mm | |
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 'arch/arm/mm')
-rw-r--r-- | arch/arm/mm/mmu.c | 6 | ||||
-rw-r--r-- | arch/arm/mm/pgd.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 434d76f0b363..88fbe0d23ca6 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -732,7 +732,7 @@ static void *__init late_alloc(unsigned long sz) | |||
732 | return ptr; | 732 | return ptr; |
733 | } | 733 | } |
734 | 734 | ||
735 | static pte_t * __init pte_alloc(pmd_t *pmd, unsigned long addr, | 735 | static pte_t * __init arm_pte_alloc(pmd_t *pmd, unsigned long addr, |
736 | unsigned long prot, | 736 | unsigned long prot, |
737 | void *(*alloc)(unsigned long sz)) | 737 | void *(*alloc)(unsigned long sz)) |
738 | { | 738 | { |
@@ -747,7 +747,7 @@ static pte_t * __init pte_alloc(pmd_t *pmd, unsigned long addr, | |||
747 | static pte_t * __init early_pte_alloc(pmd_t *pmd, unsigned long addr, | 747 | static pte_t * __init early_pte_alloc(pmd_t *pmd, unsigned long addr, |
748 | unsigned long prot) | 748 | unsigned long prot) |
749 | { | 749 | { |
750 | return pte_alloc(pmd, addr, prot, early_alloc); | 750 | return arm_pte_alloc(pmd, addr, prot, early_alloc); |
751 | } | 751 | } |
752 | 752 | ||
753 | static void __init alloc_init_pte(pmd_t *pmd, unsigned long addr, | 753 | static void __init alloc_init_pte(pmd_t *pmd, unsigned long addr, |
@@ -756,7 +756,7 @@ static void __init alloc_init_pte(pmd_t *pmd, unsigned long addr, | |||
756 | void *(*alloc)(unsigned long sz), | 756 | void *(*alloc)(unsigned long sz), |
757 | bool ng) | 757 | bool ng) |
758 | { | 758 | { |
759 | pte_t *pte = pte_alloc(pmd, addr, type->prot_l1, alloc); | 759 | pte_t *pte = arm_pte_alloc(pmd, addr, type->prot_l1, alloc); |
760 | do { | 760 | do { |
761 | set_pte_ext(pte, pfn_pte(pfn, __pgprot(type->prot_pte)), | 761 | set_pte_ext(pte, pfn_pte(pfn, __pgprot(type->prot_pte)), |
762 | ng ? PTE_EXT_NG : 0); | 762 | ng ? PTE_EXT_NG : 0); |
diff --git a/arch/arm/mm/pgd.c b/arch/arm/mm/pgd.c index e683db1b90a3..b8d477321730 100644 --- a/arch/arm/mm/pgd.c +++ b/arch/arm/mm/pgd.c | |||
@@ -80,7 +80,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm) | |||
80 | if (!new_pmd) | 80 | if (!new_pmd) |
81 | goto no_pmd; | 81 | goto no_pmd; |
82 | 82 | ||
83 | new_pte = pte_alloc_map(mm, NULL, new_pmd, 0); | 83 | new_pte = pte_alloc_map(mm, new_pmd, 0); |
84 | if (!new_pte) | 84 | if (!new_pte) |
85 | goto no_pte; | 85 | goto no_pte; |
86 | 86 | ||