mm/hugetlb: Simplify hugetlb unmap
Subsystems (11)
RFC PATCH 1/4 mm/hugetlb: Simplify hugetlb unmap
For hugetlb like THP (and unlike regular page), we do tlb flush after dropping ptl. Because of the above, we don't need to track force_flush like we do now. Instead we can simply call tlb_remove_page() which will do the flush if needed.
No functionality change in this patch.
--- mm/hugetlb.c | 54 +++++++++++++++++++++--------------------------------- 1 file changed, 21 insertions(+), 33 deletions(-)
mm/hugetlb.c +21 -33
@@ -3138,7 +3138,6 @@ void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma, unsigned long start, unsigned long end, struct page *ref_page) { - int force_flush = 0; struct mm_struct *mm = vma->vm_mm;unsigned long address;pte_t *ptep;
@@ -3157,19 +3156,22 @@ void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma,tlb_start_vma (tlb, vma);mmu_notifier_invalidate_range_start (mm, mmun_start, mmun_end); address = start; -again:for (; address < end; address += sz) { ptep =huge_pte_offset (mm, address);if (!ptep)continue ; ptl =huge_pte_lock (h, mm, ptep); -if (huge_pmd_unshare (mm, &address, ptep)) - goto unlock; +if (huge_pmd_unshare (mm, &address, ptep)) { +spin_unlock (ptl); +continue ; + } pte =huge_ptep_get (ptep); -if (huge_pte_none (pte)) - goto unlock; +if (huge_pte_none (pte)) { +spin_unlock (ptl); +continue ; + }/* * Migrating hugepage or HWPoisoned hugepage is already
@@ -3177,7 +3179,8 @@ again:*/ if (unlikely (!pte_present (pte))) {huge_pte_clear (mm, address, ptep); - goto unlock; +spin_unlock (ptl); +continue ; } page =pte_page (pte);
@@ -3187,9 +3190,10 @@ again:* are about to unmap is the actual page of interest. */ if (ref_page) { -if (page != ref_page) - goto unlock; - +if (page != ref_page) { +spin_unlock (ptl); +continue ; + }/* * Mark the VMA as having unmapped its page so that * future faults in this VMA will fail rather than
@@ -3205,30 +3209,14 @@ again:hugetlb_count_sub (pages_per_huge_page (h), mm);page_remove_rmap (page, true); - force_flush = !__tlb_remove_page (tlb, page); -if (force_flush) { - address += sz; -spin_unlock (ptl); -break ; - } -/* Bail out after unmapping reference page if supplied */ -if (ref_page) { -spin_unlock (ptl); -break ; - } -unlock: +spin_unlock (ptl); - } -/* -* mmu_gather ran out of room to batch pages, we break out of -* the PTE lock to avoid doing the potential expensive TLB invalidate -* and page-free while holding it. -*/ -if (force_flush) { - force_flush =0 ; -tlb_flush_mmu (tlb); -if (address < end && !ref_page) - goto again; +tlb_remove_page (tlb, page); +/* +* Bail out after unmapping reference page if supplied +*/ +if (ref_page) +break ; }mmu_notifier_invalidate_range_end (mm, mmun_start, mmun_end);tlb_end_vma (tlb, vma);
Signature · 7 lines
2.7.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
RFC PATCH 2/4 mm: Change the interface for __tlb_remove_page
This update the generic and arch specific implementation to return true if we need to do a tlb flush. That means if a __tlb_remove_page indicate a flush is needed, the page we try to remove need to be tracked and added again after the flush. We need to track it because we have already update the pte to none and we can't just loop back.
This changes is done to enable us to do a tlb_flush when we try to flush a range that consists of different page sizes. For architectures like ppc64, we can do a range based tlb flush and we need to track page size for that. When we try to remove a huge page, we will force a tlb flush and starts a new mmu gather.
--- arch/arm/include/asm/tlb.h | 11 +++++++---- arch/ia64/include/asm/tlb.h | 13 ++++++++----- arch/s390/include/asm/tlb.h | 4 ++-- arch/sh/include/asm/tlb.h | 2 +- arch/um/include/asm/tlb.h | 2 +- include/asm-generic/tlb.h | 18 ++++++++++++++++-- mm/memory.c | 20 ++++++++++++++------ 7 files changed, 49 insertions(+), 21 deletions(-)
arch/arm/include/asm/tlb.h +7 -4
@@ -209,17 +209,20 @@ tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vma)tlb_flush (tlb); } -static inline int __tlb_remove_page (struct mmu_gather *tlb,struct page *page) +static inline bool __tlb_remove_page (struct mmu_gather *tlb,struct page *page) { +if (tlb->nr == tlb->max) +return true; tlb->pages[tlb->nr++] = page; -VM_BUG_ON (tlb->nr > tlb->max); -return tlb->max - tlb->nr; +return false; }static inline void tlb_remove_page (struct mmu_gather *tlb,struct page *page) { -if (!__tlb_remove_page (tlb, page)) +if (__tlb_remove_page (tlb, page)) {tlb_flush_mmu (tlb); +__tlb_remove_page (tlb, page); + } } static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte,
arch/ia64/include/asm/tlb.h +8 -5
@@ -205,17 +205,18 @@ tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)* must be delayed until after the TLB has been flushed (see comments at the beginning of * this file). */ -static inline int __tlb_remove_page (struct mmu_gather *tlb,struct page *page) +static inline bool __tlb_remove_page (struct mmu_gather *tlb,struct page *page) { +if (tlb->nr == tlb->max) +return true; + tlb->need_flush =1 ;if (!tlb->nr && tlb->pages == tlb->local)__tlb_alloc_page (tlb); tlb->pages[tlb->nr++] = page; -VM_BUG_ON (tlb->nr > tlb->max); - -return tlb->max - tlb->nr; +return false; }static inline void tlb_flush_mmu_tlbonly (struct mmu_gather *tlb)
@@ -235,8 +236,10 @@ static inline void tlb_flush_mmu(struct mmu_gather *tlb)static inline void tlb_remove_page (struct mmu_gather *tlb,struct page *page) { -if (!__tlb_remove_page (tlb, page)) +if (__tlb_remove_page (tlb, page)) {tlb_flush_mmu (tlb); +__tlb_remove_page (tlb, page); + } }/*
arch/s390/include/asm/tlb.h +2 -2
@@ -87,10 +87,10 @@ static inline void tlb_finish_mmu(struct mmu_gather *tlb,* tlb_ptep_clear_flush. In both flush modes the tlb for a page cache page * has already been freed, so just do free_page_and_swap_cache. */ -static inline int __tlb_remove_page (struct mmu_gather *tlb,struct page *page) +static inline bool __tlb_remove_page (struct mmu_gather *tlb,struct page *page) {free_page_and_swap_cache (page); -return 1 ;/* avoid calling tlb_flush_mmu */ +return false;/* avoid calling tlb_flush_mmu */ }static inline void tlb_remove_page (struct mmu_gather *tlb,struct page *page)
arch/sh/include/asm/tlb.h +1 -1
@@ -101,7 +101,7 @@ static inline void tlb_flush_mmu(struct mmu_gather *tlb)static inline int __tlb_remove_page (struct mmu_gather *tlb,struct page *page) {free_page_and_swap_cache (page); -return 1 ;/* avoid calling tlb_flush_mmu */ +return false;/* avoid calling tlb_flush_mmu */ }static inline void tlb_remove_page (struct mmu_gather *tlb,struct page *page)
arch/um/include/asm/tlb.h +1 -1
@@ -102,7 +102,7 @@ static inline int __tlb_remove_page(struct mmu_gather *tlb, struct page *page) { tlb->need_flush =1 ;free_page_and_swap_cache (page); -return 1 ;/* avoid calling tlb_flush_mmu */ +return false;/* avoid calling tlb_flush_mmu */ }static inline void tlb_remove_page (struct mmu_gather *tlb,struct page *page)
include/asm-generic/tlb.h +16 -2
@@ -107,6 +107,11 @@ struct mmu_gather {struct mmu_gather_batch local;struct page *__pages[MMU_GATHER_BUNDLE ];unsigned int batch_count; +/* +* __tlb_adjust_range will track the new addr here, +* that that we can adjust the range after the flush +*/ +unsigned long addr; };#define HAVE_GENERIC_MMU_GATHER
@@ -115,7 +120,7 @@ void tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, unsigned longvoid tlb_flush_mmu (struct mmu_gather *tlb);void tlb_finish_mmu (struct mmu_gather *tlb,unsigned long start,unsigned long end); -int __tlb_remove_page (struct mmu_gather *tlb,struct page *page); +bool __tlb_remove_page (struct mmu_gather *tlb,struct page *page);/* tlb_remove_page * Similar to __tlb_remove_page but will call tlb_flush_mmu() itself when
@@ -123,8 +128,11 @@ int __tlb_remove_page(struct mmu_gather *tlb, struct page *page);*/ static inline void tlb_remove_page (struct mmu_gather *tlb,struct page *page) { -if (!__tlb_remove_page (tlb, page)) +if (__tlb_remove_page (tlb, page)) {tlb_flush_mmu (tlb); +__tlb_adjust_range (tlb, tlb->addr); +__tlb_remove_page (tlb, page); + } } static inline void __tlb_adjust_range(struct mmu_gather *tlb,
@@ -132,6 +140,12 @@ static inline void __tlb_adjust_range(struct mmu_gather *tlb, { tlb->start =min (tlb->start, address); tlb->end =max (tlb->end, address +PAGE_SIZE ); +/* +* Track the last address with which we adjusted the range. This +* will be used later to adjust again after a mmu_flush due to +* failed __tlb_remove_page +*/ + tlb->addr = address; }static inline void __tlb_reset_range (struct mmu_gather *tlb)
mm/memory.c +14 -6
@@ -292,23 +292,24 @@ void tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long e* handling the additional races in SMP caused by other CPUs caching valid * mappings in their TLBs. Returns the number of free page slots left. * When out of page slots we must call tlb_flush_mmu(). +*returns true if the caller should flush. */ -int __tlb_remove_page (struct mmu_gather *tlb,struct page *page) +bool __tlb_remove_page (struct mmu_gather *tlb,struct page *page) {struct mmu_gather_batch *batch;VM_BUG_ON (!tlb->end); batch = tlb->active; - batch->pages[batch->nr++] = page;if (batch->nr == batch->max) {if (!tlb_next_batch (tlb)) -return 0 ; +return true; batch = tlb->active; }VM_BUG_ON_PAGE (batch->nr > batch->max, page); -return batch->max - batch->nr; + batch->pages[batch->nr++] = page; +return false; }#endif /* HAVE_GENERIC_MMU_GATHER */
@@ -1109,6 +1110,7 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb,pte_t *start_pte;pte_t *pte;swp_entry_t entry; +struct page *pending_page =NULL ; again:init_rss_vec (rss);
@@ -1160,8 +1162,9 @@ again:page_remove_rmap (page, false);if (unlikely (page_mapcount (page) <0 ))print_bad_pte (vma, addr, ptent, page); -if (unlikely (!__tlb_remove_page (tlb, page))) { +if (unlikely (__tlb_remove_page (tlb, page))) { force_flush =1 ; + pending_page = page; addr +=PAGE_SIZE ;break ; }
@@ -1202,7 +1205,12 @@ again:if (force_flush) { force_flush =0 ;tlb_flush_mmu_free (tlb); - +if (pending_page) { +/* remove the page with new size */ +__tlb_adjust_range (tlb, tlb->addr); +__tlb_remove_page (tlb, pending_page); + pending_page =NULL ; + }if (addr != end) goto again; }
Signature · 7 lines
2.7.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
RFC PATCH 3/4 mm/mmu_gather: Track page size with mmu gather and force flush if page size change
In reply to Aneesh Kumar K.VThis allows arch which need to do special handing with respect to different page size when flushing tlb to implement the same in mmu gather
--- arch/arm/include/asm/tlb.h | 18 +++++++++++++++ arch/ia64/include/asm/tlb.h | 18 +++++++++++++++ arch/s390/include/asm/tlb.h | 18 +++++++++++++++ arch/sh/include/asm/tlb.h | 18 +++++++++++++++ arch/um/include/asm/tlb.h | 18 +++++++++++++++ include/asm-generic/tlb.h | 56 +++++++++++++++++++++++++++++++++------------ mm/huge_memory.c | 2 +- mm/hugetlb.c | 2 +- mm/memory.c | 13 ++++++++--- 9 files changed, 144 insertions(+), 19 deletions(-)
arch/arm/include/asm/tlb.h +18 -0
@@ -225,6 +225,24 @@ static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page) } } +static inline bool __tlb_remove_page_size (struct mmu_gather *tlb, +struct page *page,int page_size) +{ +return __tlb_remove_page (tlb, page); +} + +static inline bool __tlb_remove_pte_page (struct mmu_gather *tlb, +struct page *page) +{ +return __tlb_remove_page (tlb, page); +} + +static inline void tlb_remove_page_size (struct mmu_gather *tlb, +struct page *page,int page_size) +{ +return tlb_remove_page (tlb, page); +} +static inline void __pte_free_tlb (struct mmu_gather *tlb,pgtable_t pte,unsigned long addr) {
arch/ia64/include/asm/tlb.h +18 -0
@@ -242,6 +242,24 @@ static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page) } } +static inline bool __tlb_remove_page_size (struct mmu_gather *tlb, +struct page *page,int page_size) +{ +return __tlb_remove_page (tlb, page); +} + +static inline bool __tlb_remove_pte_page (struct mmu_gather *tlb, +struct page *page) +{ +return __tlb_remove_page (tlb, page); +} + +static inline void tlb_remove_page_size (struct mmu_gather *tlb, +struct page *page,int page_size) +{ +return tlb_remove_page (tlb, page); +} +/* * Remove TLB entry for PTE mapped at virtual address ADDRESS. This is called for any * PTE, not just those pointing to (normal) physical memory.
arch/s390/include/asm/tlb.h +18 -0
@@ -98,6 +98,24 @@ static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)free_page_and_swap_cache (page); } +static inline bool __tlb_remove_page_size (struct mmu_gather *tlb, +struct page *page,int page_size) +{ +return __tlb_remove_page (tlb, page); +} + +static inline bool __tlb_remove_pte_page (struct mmu_gather *tlb, +struct page *page) +{ +return __tlb_remove_page (tlb, page); +} + +static inline void tlb_remove_page_size (struct mmu_gather *tlb, +struct page *page,int page_size) +{ +return tlb_remove_page (tlb, page); +} +/* * pte_free_tlb frees a pte table and clears the CRSTE for the * page table from the tlb.
arch/sh/include/asm/tlb.h +18 -0
@@ -109,6 +109,24 @@ static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)__tlb_remove_page (tlb, page); } +static inline bool __tlb_remove_page_size (struct mmu_gather *tlb, +struct page *page,int page_size) +{ +return __tlb_remove_page (tlb, page); +} + +static inline bool __tlb_remove_pte_page (struct mmu_gather *tlb, +struct page *page) +{ +return __tlb_remove_page (tlb, page); +} + +static inline void tlb_remove_page_size (struct mmu_gather *tlb, +struct page *page,int page_size) +{ +return tlb_remove_page (tlb, page); +} +#define pte_free_tlb (tlb, ptep, addr) pte_free((tlb)->mm, ptep)#define pmd_free_tlb (tlb, pmdp, addr) pmd_free((tlb)->mm, pmdp)#define pud_free_tlb (tlb, pudp, addr) pud_free((tlb)->mm, pudp)
arch/um/include/asm/tlb.h +18 -0
@@ -110,6 +110,24 @@ static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)__tlb_remove_page (tlb, page); } +static inline bool __tlb_remove_page_size (struct mmu_gather *tlb, +struct page *page,int page_size) +{ +return __tlb_remove_page (tlb, page); +} + +static inline bool __tlb_remove_pte_page (struct mmu_gather *tlb, +struct page *page) +{ +return __tlb_remove_page (tlb, page); +} + +static inline void tlb_remove_page_size (struct mmu_gather *tlb, +struct page *page,int page_size) +{ +return tlb_remove_page (tlb, page); +} +/** * tlb_remove_tlb_entry - remember a pte unmapping for later tlb invalidation. *
include/asm-generic/tlb.h +42 -14
79 lines not on this page · raw message
mm/huge_memory.c +1 -1
@@ -1694,7 +1694,7 @@ int zap_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma,pte_free (tlb->mm,pgtable_trans_huge_withdraw (tlb->mm, pmd));atomic_long_dec (&tlb->mm->nr_ptes);spin_unlock (ptl); -tlb_remove_page (tlb, page); +tlb_remove_page_size (tlb, page,HPAGE_PMD_SIZE ); }return 1 ; }
mm/hugetlb.c +1 -1
@@ -3211,7 +3211,7 @@ void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma,page_remove_rmap (page, true);spin_unlock (ptl); -tlb_remove_page (tlb, page); +tlb_remove_page_size (tlb, page,huge_page_size (h));/* * Bail out after unmapping reference page if supplied */
mm/memory.c +10 -3
@@ -233,6 +233,7 @@ void tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, unsigned long#ifdef CONFIG_HAVE_RCU_TABLE_FREE tlb->batch =NULL ;#endif + tlb->page_size =0 ;__tlb_reset_range (tlb); }
@@ -294,12 +295,19 @@ void tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long e* When out of page slots we must call tlb_flush_mmu(). *returns true if the caller should flush. */ -bool __tlb_remove_page (struct mmu_gather *tlb,struct page *page) +bool __tlb_remove_page_size (struct mmu_gather *tlb,struct page *page,int page_size) {struct mmu_gather_batch *batch;VM_BUG_ON (!tlb->end); +if (!tlb->page_size) + tlb->page_size = page_size; +else { +if (page_size != tlb->page_size) +return true; + } + batch = tlb->active;if (batch->nr == batch->max) {if (!tlb_next_batch (tlb))
@@ -1207,8 +1215,7 @@ again:tlb_flush_mmu_free (tlb);if (pending_page) {/* remove the page with new size */ -__tlb_adjust_range (tlb, tlb->addr); -__tlb_remove_page (tlb, pending_page); +__tlb_remove_pte_page (tlb, pending_page); pending_page =NULL ; }if (addr != end)
Signature · 7 lines
2.7.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
RFC PATCH 4/4 powerpc/mm/radix: Implement tlb mmu gather flush efficiently
In reply to Aneesh Kumar K.Vif mmu gather flush resulted in a page table free force a RIC=2 flush with IS=1. Otherwise do a range flush with IS=0 and RIC=0
--- arch/powerpc/include/asm/book3s/32/pgalloc.h | 1 - arch/powerpc/include/asm/book3s/64/pgalloc.h | 16 ++++++++++++- arch/powerpc/include/asm/book3s/64/tlbflush.h | 1 + arch/powerpc/include/asm/book3s/pgalloc.h | 5 ---- arch/powerpc/mm/tlb-radix.c | 34 +++++++++++++++++++++++++-- 5 files changed, 48 insertions(+), 9 deletions(-)
arch/powerpc/include/asm/book3s/32/pgalloc.h +0 -1
@@ -102,7 +102,6 @@ static inline void pgtable_free_tlb(struct mmu_gather *tlb,static inline void __pte_free_tlb (struct mmu_gather *tlb,pgtable_t table,unsigned long address) { -tlb_flush_pgtable (tlb, address);pgtable_page_dtor (table);pgtable_free_tlb (tlb,page_address (table),0 ); }
arch/powerpc/include/asm/book3s/64/pgalloc.h +15 -1
@@ -110,6 +110,11 @@ static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)static inline void __pud_free_tlb (struct mmu_gather *tlb,pud_t *pud,unsigned long address) { +/* +* By now all the pud entries should be none entries. So go +* ahead and flush the page walk cache +*/ +flush_tlb_pgtable (tlb, address);pgtable_free_tlb (tlb, pud,PUD_INDEX_SIZE ); }
@@ -127,6 +132,11 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)static inline void __pmd_free_tlb (struct mmu_gather *tlb,pmd_t *pmd,unsigned long address) { +/* +* By now all the pud entries should be none entries. So go +* ahead and flush the page walk cache +*/ +flush_tlb_pgtable (tlb, address);return pgtable_free_tlb (tlb, pmd,PMD_CACHE_INDEX ); }
@@ -198,7 +208,11 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage)static inline void __pte_free_tlb (struct mmu_gather *tlb,pgtable_t table,unsigned long address) { -tlb_flush_pgtable (tlb, address); +/* +* By now all the pud entries should be none entries. So go +* ahead and flush the page walk cache +*/ +flush_tlb_pgtable (tlb, address);pgtable_free_tlb (tlb, table,0 ); }
arch/powerpc/include/asm/book3s/64/tlbflush.h +1 -0
@@ -84,4 +84,5 @@ static inline void flush_tlb_page(struct vm_area_struct *vma,#define flush_tlb_page (vma, addr) local_flush_tlb_page(vma, addr)#endif /* CONFIG_SMP */ +extern void flush_tlb_pgtable (struct mmu_gather *tlb,unsigned long address);#endif /* _ASM_POWERPC_BOOK3S_64_TLBFLUSH_H */
arch/powerpc/include/asm/book3s/pgalloc.h +0 -5
@@ -4,11 +4,6 @@#include <linux/mm.h> extern void tlb_remove_table (struct mmu_gather *tlb,void *table); -static inline void tlb_flush_pgtable (struct mmu_gather *tlb, -unsigned long address) -{ - -}#ifdef CONFIG_PPC64 #include <asm/book3s/64/pgalloc.h>
arch/powerpc/mm/tlb-radix.c +32 -2
@@ -239,13 +239,32 @@ void radix__flush_tlb_range(struct vm_area_struct *vma, unsigned long start, }EXPORT_SYMBOL (radix__flush_tlb_range); -void radix__tlb_flush (struct mmu_gather *tlb) { +int psize =0 ;struct mm_struct *mm = tlb->mm; -radix__flush_tlb_mm (mm); +int page_size = tlb->page_size; + +if (page_size == (1UL << mmu_psize_defs[mmu_virtual_psize].shift)) + psize = mmu_virtual_psize; +else if (page_size == (1UL << mmu_psize_defs[MMU_PAGE_2M ].shift)) + psize =MMU_PAGE_2M ; +else if (page_size == (1UL << mmu_psize_defs[MMU_PAGE_1G ].shift)) + psize =MMU_PAGE_1G ; +else + goto flush_mm; + + +if (!tlb->fullmm && !tlb->need_flush_all) { +radix__flush_tlb_range_psize (mm, tlb->start, tlb->end, psize); + }else { +flush_mm: +radix__flush_tlb_mm (mm); + } } + +#define TLB_FLUSH_ALL -1UL/* * Number of pages above which we will do a bcast tlbie. Just a
@@ -299,3 +318,14 @@ void radix__flush_pmd_tlb_range(struct vm_area_struct *vma,radix__flush_tlb_range_psize (vma->vm_mm, start, end,MMU_PAGE_2M ); }EXPORT_SYMBOL (radix__flush_pmd_tlb_range); +/* +* flush the page walk cache for the address +*/ +void flush_tlb_pgtable (struct mmu_gather *tlb,unsigned long address) +{ +/* +* If we are doing a range flush with mmu gather, since we have +* done a page table free, force a page walk cache flush. +*/ + tlb->need_flush_all =1 ; +}
Signature · 7 lines
2.7.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Andrew Morton
maintainerQuoted 6 lines · On Mon, 30 May 2016 11:14:19 +0530 "Aneesh Kumar K.V"…
For hugetlb like THP (and unlike regular page), we do tlb flush after dropping ptl. Because of the above, we don't need to track
force_flushlike we do now. Instead we can simply calltlb_remove_page()which will do the flush if needed.No functionality change in this patch.
This all looks fairly non-horrifying. Will a non-RFC version be forthcoming?
Quoted 11 lines · Andrew Morton
Quoted 6 lines · On Mon, 30 May 2016 11:14:19 +0530 "Aneesh Kumar K.V"…
For hugetlb like THP (and unlike regular page), we do tlb flush after dropping ptl. Because of the above, we don't need to track
force_flushlike we do now. Instead we can simply calltlb_remove_page()which will do the flush if needed.No functionality change in this patch.
This all looks fairly non-horrifying. Will a non-RFC version be forthcoming?
Yes. I will send an updated version of the series. Patch 4 may need to go through powerpc tree because of other dependent patches. I will continue to include that in the series to show the arch related changes.
-aneesh