summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2015-06-24 19:57:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-06-24 20:49:44 -0400
commit8809aa2d28d74111ff2f1928edaa4e9845c97a7d (patch)
treef99977c0135ee38e8d7f1cea575cb2b9b7f3b669 /arch
parentf28b6ff8c3d48af21354ef30164c8ccea69d5928 (diff)
mm: clarify that the function operates on hugepage pte
We have confusing functions to clear pmd, pmd_clear_* and pmd_clear. Add _huge_ to pmdp_clear functions so that we are clear that they operate on hugepage pte. We don't bother about other functions like pmdp_set_wrprotect, pmdp_clear_flush_young, because they operate on PTE bits and hence indicate they are operating on hugepage ptes Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/include/asm/pgtable.h8
-rw-r--r--arch/powerpc/include/asm/pgtable-ppc64.h6
-rw-r--r--arch/powerpc/mm/pgtable_64.c4
-rw-r--r--arch/s390/include/asm/pgtable.h24
-rw-r--r--arch/sparc/include/asm/pgtable_64.h8
-rw-r--r--arch/tile/include/asm/pgtable.h8
-rw-r--r--arch/x86/include/asm/pgtable.h4
7 files changed, 31 insertions, 31 deletions
diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h
index 819af9d057a8..9d8106758142 100644
--- a/arch/mips/include/asm/pgtable.h
+++ b/arch/mips/include/asm/pgtable.h
@@ -568,12 +568,12 @@ static inline pmd_t pmd_mknotpresent(pmd_t pmd)
568} 568}
569 569
570/* 570/*
571 * The generic version pmdp_get_and_clear uses a version of pmd_clear() with a 571 * The generic version pmdp_huge_get_and_clear uses a version of pmd_clear() with a
572 * different prototype. 572 * different prototype.
573 */ 573 */
574#define __HAVE_ARCH_PMDP_GET_AND_CLEAR 574#define __HAVE_ARCH_PMDP_HUGE_GET_AND_CLEAR
575static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm, 575static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm,
576 unsigned long address, pmd_t *pmdp) 576 unsigned long address, pmd_t *pmdp)
577{ 577{
578 pmd_t old = *pmdp; 578 pmd_t old = *pmdp;
579 579
diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h
index 34ffbf52d078..3bb7488bd24b 100644
--- a/arch/powerpc/include/asm/pgtable-ppc64.h
+++ b/arch/powerpc/include/asm/pgtable-ppc64.h
@@ -569,9 +569,9 @@ extern int pmdp_test_and_clear_young(struct vm_area_struct *vma,
569extern int pmdp_clear_flush_young(struct vm_area_struct *vma, 569extern int pmdp_clear_flush_young(struct vm_area_struct *vma,
570 unsigned long address, pmd_t *pmdp); 570 unsigned long address, pmd_t *pmdp);
571 571
572#define __HAVE_ARCH_PMDP_GET_AND_CLEAR 572#define __HAVE_ARCH_PMDP_HUGE_GET_AND_CLEAR
573extern pmd_t pmdp_get_and_clear(struct mm_struct *mm, 573extern pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm,
574 unsigned long addr, pmd_t *pmdp); 574 unsigned long addr, pmd_t *pmdp);
575 575
576#define __HAVE_ARCH_PMDP_SET_WRPROTECT 576#define __HAVE_ARCH_PMDP_SET_WRPROTECT
577static inline void pmdp_set_wrprotect(struct mm_struct *mm, unsigned long addr, 577static inline void pmdp_set_wrprotect(struct mm_struct *mm, unsigned long addr,
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index f7775193d745..876232d64126 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -812,8 +812,8 @@ void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long addr,
812 return; 812 return;
813} 813}
814 814
815pmd_t pmdp_get_and_clear(struct mm_struct *mm, 815pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm,
816 unsigned long addr, pmd_t *pmdp) 816 unsigned long addr, pmd_t *pmdp)
817{ 817{
818 pmd_t old_pmd; 818 pmd_t old_pmd;
819 pgtable_t pgtable; 819 pgtable_t pgtable;
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
index 7242dd386ab7..f66d82798a6a 100644
--- a/arch/s390/include/asm/pgtable.h
+++ b/arch/s390/include/asm/pgtable.h
@@ -1498,9 +1498,9 @@ static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma,
1498 return pmd_young(pmd); 1498 return pmd_young(pmd);
1499} 1499}
1500 1500
1501#define __HAVE_ARCH_PMDP_GET_AND_CLEAR 1501#define __HAVE_ARCH_PMDP_HUGE_GET_AND_CLEAR
1502static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm, 1502static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm,
1503 unsigned long address, pmd_t *pmdp) 1503 unsigned long address, pmd_t *pmdp)
1504{ 1504{
1505 pmd_t pmd = *pmdp; 1505 pmd_t pmd = *pmdp;
1506 1506
@@ -1509,10 +1509,10 @@ static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm,
1509 return pmd; 1509 return pmd;
1510} 1510}
1511 1511
1512#define __HAVE_ARCH_PMDP_GET_AND_CLEAR_FULL 1512#define __HAVE_ARCH_PMDP_HUGE_GET_AND_CLEAR_FULL
1513static inline pmd_t pmdp_get_and_clear_full(struct mm_struct *mm, 1513static inline pmd_t pmdp_huge_get_and_clear_full(struct mm_struct *mm,
1514 unsigned long address, 1514 unsigned long address,
1515 pmd_t *pmdp, int full) 1515 pmd_t *pmdp, int full)
1516{ 1516{
1517 pmd_t pmd = *pmdp; 1517 pmd_t pmd = *pmdp;
1518 1518
@@ -1522,11 +1522,11 @@ static inline pmd_t pmdp_get_and_clear_full(struct mm_struct *mm,
1522 return pmd; 1522 return pmd;
1523} 1523}
1524 1524
1525#define __HAVE_ARCH_PMDP_CLEAR_FLUSH 1525#define __HAVE_ARCH_PMDP_HUGE_CLEAR_FLUSH
1526static inline pmd_t pmdp_clear_flush(struct vm_area_struct *vma, 1526static inline pmd_t pmdp_huge_clear_flush(struct vm_area_struct *vma,
1527 unsigned long address, pmd_t *pmdp) 1527 unsigned long address, pmd_t *pmdp)
1528{ 1528{
1529 return pmdp_get_and_clear(vma->vm_mm, address, pmdp); 1529 return pmdp_huge_get_and_clear(vma->vm_mm, address, pmdp);
1530} 1530}
1531 1531
1532#define __HAVE_ARCH_PMDP_INVALIDATE 1532#define __HAVE_ARCH_PMDP_INVALIDATE
@@ -1552,7 +1552,7 @@ static inline pmd_t pmdp_collapse_flush(struct vm_area_struct *vma,
1552 unsigned long address, 1552 unsigned long address,
1553 pmd_t *pmdp) 1553 pmd_t *pmdp)
1554{ 1554{
1555 return pmdp_get_and_clear(vma->vm_mm, address, pmdp); 1555 return pmdp_huge_get_and_clear(vma->vm_mm, address, pmdp);
1556} 1556}
1557#define pmdp_collapse_flush pmdp_collapse_flush 1557#define pmdp_collapse_flush pmdp_collapse_flush
1558 1558
diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/include/asm/pgtable_64.h
index 2a52c91d2c8a..131d36fcd07a 100644
--- a/arch/sparc/include/asm/pgtable_64.h
+++ b/arch/sparc/include/asm/pgtable_64.h
@@ -865,10 +865,10 @@ static inline unsigned long pud_pfn(pud_t pud)
865void tlb_batch_add(struct mm_struct *mm, unsigned long vaddr, 865void tlb_batch_add(struct mm_struct *mm, unsigned long vaddr,
866 pte_t *ptep, pte_t orig, int fullmm); 866 pte_t *ptep, pte_t orig, int fullmm);
867 867
868#define __HAVE_ARCH_PMDP_GET_AND_CLEAR 868#define __HAVE_ARCH_PMDP_HUGE_GET_AND_CLEAR
869static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm, 869static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm,
870 unsigned long addr, 870 unsigned long addr,
871 pmd_t *pmdp) 871 pmd_t *pmdp)
872{ 872{
873 pmd_t pmd = *pmdp; 873 pmd_t pmd = *pmdp;
874 set_pmd_at(mm, addr, pmdp, __pmd(0UL)); 874 set_pmd_at(mm, addr, pmdp, __pmd(0UL));
diff --git a/arch/tile/include/asm/pgtable.h b/arch/tile/include/asm/pgtable.h
index 95a4f19d16c5..2b05ccbebed9 100644
--- a/arch/tile/include/asm/pgtable.h
+++ b/arch/tile/include/asm/pgtable.h
@@ -414,10 +414,10 @@ static inline void pmdp_set_wrprotect(struct mm_struct *mm,
414} 414}
415 415
416 416
417#define __HAVE_ARCH_PMDP_GET_AND_CLEAR 417#define __HAVE_ARCH_PMDP_HUGE_GET_AND_CLEAR
418static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm, 418static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm,
419 unsigned long address, 419 unsigned long address,
420 pmd_t *pmdp) 420 pmd_t *pmdp)
421{ 421{
422 return pte_pmd(ptep_get_and_clear(mm, address, pmdp_ptep(pmdp))); 422 return pte_pmd(ptep_get_and_clear(mm, address, pmdp_ptep(pmdp)));
423} 423}
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 2562e303405b..867da5bbb4a3 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -805,8 +805,8 @@ static inline int pmd_write(pmd_t pmd)
805 return pmd_flags(pmd) & _PAGE_RW; 805 return pmd_flags(pmd) & _PAGE_RW;
806} 806}
807 807
808#define __HAVE_ARCH_PMDP_GET_AND_CLEAR 808#define __HAVE_ARCH_PMDP_HUGE_GET_AND_CLEAR
809static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm, unsigned long addr, 809static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm, unsigned long addr,
810 pmd_t *pmdp) 810 pmd_t *pmdp)
811{ 811{
812 pmd_t pmd = native_pmdp_get_and_clear(pmdp); 812 pmd_t pmd = native_pmdp_get_and_clear(pmdp);