mm/hugetlb: add tlb_remove_hugetlb_entry for handling hugetlb pages
Subsystems (8)
[email protected]
maintainerPATCH 41/123 mm/hugetlb: add tlb_remove_hugetlb_entry for handling hugetlb pages
From: "Aneesh Kumar K.V" <[email protected]>
Subject: mm/hugetlb: add tlb_remove_hugetlb_entry for handling hugetlb pages
This add tlb_remove_hugetlb_entry similar to tlb_remove_pmd_tlb_entry.
Signed-off-by Aneesh Kumar K.V <[email protected]>
Cc "Kirill A. Shutemov" <[email protected]>
Cc Dan Williams <[email protected]>
Cc Ross Zwisler <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
arch/arm/include/asm/tlb.h | 2 ++ arch/ia64/include/asm/tlb.h | 3 +++ arch/s390/include/asm/tlb.h | 2 ++ arch/sh/include/asm/tlb.h | 3 +++ arch/um/include/asm/tlb.h | 3 +++ include/asm-generic/tlb.h | 6 ++++++ mm/hugetlb.c | 2 +- 7 files changed, 20 insertions(+), 1 deletion(-)
arch/arm/include/asm/tlb.h renamed from arch/arm/include/asm/tlb.h~mm-hugetlb-add-tlb_remove_hugetlb_entry-for-handling-hugetlb-pages +2 -0
@@ -186,6 +186,8 @@ tlb_remove_tlb_entry(struct mmu_gather *tlb_add_flush (tlb, addr); } +#define tlb_remove_huge_tlb_entry (h, tlb, ptep, address) \ + tlb_remove_tlb_entry(tlb, ptep, address)/* * In the case of tlb vma handling, we can optimise these away in the * case where we're doing a full MM flush. When we're doing a munmap,
arch/ia64/include/asm/tlb.h renamed from arch/ia64/include/asm/tlb.h~mm-hugetlb-add-tlb_remove_hugetlb_entry-for-handling-hugetlb-pages +3 -0
@@ -283,6 +283,9 @@ do { \__tlb_remove_tlb_entry (tlb, ptep, addr); \ } while (0) +#define tlb_remove_huge_tlb_entry (h, tlb, ptep, address) \ + tlb_remove_tlb_entry(tlb, ptep, address) +#define pte_free_tlb (tlb, ptep, address) \ do { \ tlb->need_flush = 1; \
arch/s390/include/asm/tlb.h renamed from arch/s390/include/asm/tlb.h~mm-hugetlb-add-tlb_remove_hugetlb_entry-for-handling-hugetlb-pages +2 -0
@@ -162,5 +162,7 @@ static inline void pud_free_tlb(struct m#define tlb_remove_tlb_entry (tlb, ptep, addr) do { } while (0)#define tlb_remove_pmd_tlb_entry (tlb, pmdp, addr) do { } while (0)#define tlb_migrate_finish (mm) do { } while (0) +#define tlb_remove_huge_tlb_entry (h, tlb, ptep, address) \ + tlb_remove_tlb_entry(tlb, ptep, address)#endif /* _S390_TLB_H */
arch/sh/include/asm/tlb.h renamed from arch/sh/include/asm/tlb.h~mm-hugetlb-add-tlb_remove_hugetlb_entry-for-handling-hugetlb-pages +3 -0
@@ -65,6 +65,9 @@ tlb_remove_tlb_entry(struct mmu_gather * tlb->end = address +PAGE_SIZE ; } +#define tlb_remove_huge_tlb_entry (h, tlb, ptep, address) \ + tlb_remove_tlb_entry(tlb, ptep, address) +/* * In the case of tlb vma handling, we can optimise these away in the * case where we're doing a full MM flush. When we're doing a munmap,
arch/um/include/asm/tlb.h renamed from arch/um/include/asm/tlb.h~mm-hugetlb-add-tlb_remove_hugetlb_entry-for-handling-hugetlb-pages +3 -0
@@ -141,6 +141,9 @@ static inline void tlb_remove_page_size(__tlb_remove_tlb_entry (tlb, ptep, address); \ } while (0) +#define tlb_remove_huge_tlb_entry (h, tlb, ptep, address) \ + tlb_remove_tlb_entry(tlb, ptep, address) +#define pte_free_tlb (tlb, ptep, addr) __pte_free_tlb(tlb, ptep, addr)#define pud_free_tlb (tlb, pudp, addr) __pud_free_tlb(tlb, pudp, addr)
include/asm-generic/tlb.h renamed from include/asm-generic/tlb.h~mm-hugetlb-add-tlb_remove_hugetlb_entry-for-handling-hugetlb-pages +6 -0
@@ -220,6 +220,12 @@ static inline bool __tlb_remove_pte_page__tlb_remove_tlb_entry (tlb, ptep, address); \ } while (0) +#define tlb_remove_huge_tlb_entry (h, tlb, ptep, address) \ + do { \ + __tlb_adjust_range(tlb, address, huge_page_size(h)); \ + __tlb_remove_tlb_entry(tlb, ptep, address); \ + } while (0) +/** * tlb_remove_pmd_tlb_entry - remember a pmd mapping for later tlb invalidation * This is a nop so far, because only x86 needs it.
mm/hugetlb.c renamed from mm/hugetlb.c~mm-hugetlb-add-tlb_remove_hugetlb_entry-for-handling-hugetlb-pages +1 -1
@@ -3336,7 +3336,7 @@ void __unmap_hugepage_range(struct mmu_g } pte =huge_ptep_get_and_clear (mm, address, ptep); -tlb_remove_tlb_entry (tlb, ptep, address); +tlb_remove_huge_tlb_entry (h, tlb, ptep, address);if (huge_pte_dirty (pte))set_page_dirty (page);
_