aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/tlb.h
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2016-07-26 18:24:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-07-26 19:19:19 -0400
commite9d55e157034a9efd99405c99c1565d64619d82b (patch)
treed97dfd0c54d5a9fd1c7b6292c64c83791f9f5278 /arch/arm/include/asm/tlb.h
parent31d49da5ad01728e48a1bb2b43795598b23de68a (diff)
mm: change the interface for __tlb_remove_page()
This updates 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 change 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. [aneesh.kumar@linux.vnet.ibm.com: mm-change-the-interface-for-__tlb_remove_page-v3] Link: http://lkml.kernel.org/r/1465049193-22197-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com Link: http://lkml.kernel.org/r/1464860389-29019-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Hugh Dickins <hughd@google.com> Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: Mel Gorman <mgorman@suse.de> Cc: David Rientjes <rientjes@google.com> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Minchan Kim <minchan.kim@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/arm/include/asm/tlb.h')
-rw-r--r--arch/arm/include/asm/tlb.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/arch/arm/include/asm/tlb.h b/arch/arm/include/asm/tlb.h
index 3cadb726ec88..a9d2aee3826f 100644
--- a/arch/arm/include/asm/tlb.h
+++ b/arch/arm/include/asm/tlb.h
@@ -209,17 +209,26 @@ tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vma)
209 tlb_flush(tlb); 209 tlb_flush(tlb);
210} 210}
211 211
212static inline int __tlb_remove_page(struct mmu_gather *tlb, struct page *page) 212static inline bool __tlb_remove_page(struct mmu_gather *tlb, struct page *page)
213{ 213{
214 if (tlb->nr == tlb->max)
215 return true;
214 tlb->pages[tlb->nr++] = page; 216 tlb->pages[tlb->nr++] = page;
215 VM_BUG_ON(tlb->nr > tlb->max); 217 return false;
216 return tlb->max - tlb->nr;
217} 218}
218 219
219static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page) 220static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
220{ 221{
221 if (!__tlb_remove_page(tlb, page)) 222 if (__tlb_remove_page(tlb, page)) {
222 tlb_flush_mmu(tlb); 223 tlb_flush_mmu(tlb);
224 __tlb_remove_page(tlb, page);
225 }
226}
227
228static inline bool __tlb_remove_pte_page(struct mmu_gather *tlb,
229 struct page *page)
230{
231 return __tlb_remove_page(tlb, page);
223} 232}
224 233
225static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte, 234static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte,