Lines Matching refs:tlb
1 /* asm-generic/tlb.h
3 * Generic TLB shootdown code
21 * For UP we don't need to worry about TLB flush
30 #define tlb_fast_mode(tlb) ((tlb)->nr == ~0U)
33 #define tlb_fast_mode(tlb) 1
47 /* Users of the generic TLB shootdown code must declare this storage space. */
56 struct mmu_gather *tlb = &get_cpu_var(mmu_gathers);
58 tlb->mm = mm;
61 tlb->nr = num_online_cpus() > 1 ? 0U : ~0U;
63 tlb->fullmm = full_mm_flush;
65 return tlb;
69 tlb_flush_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
71 if (!tlb->need_flush)
73 tlb->need_flush = 0;
74 tlb_flush(tlb);
75 if (!tlb_fast_mode(tlb)) {
76 free_pages_and_swap_cache(tlb->pages, tlb->nr);
77 tlb->nr = 0;
86 tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
88 tlb_flush_mmu(tlb, start, end);
101 static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
103 tlb->need_flush = 1;
104 if (tlb_fast_mode(tlb)) {
108 tlb->pages[tlb->nr++] = page;
109 if (tlb->nr >= FREE_PTE_NR)
110 tlb_flush_mmu(tlb, 0, 0);
114 * tlb_remove_tlb_entry - remember a pte unmapping for later tlb invalidation.
117 * later optimise away the tlb invalidate. This helps when userspace is
120 #define tlb_remove_tlb_entry(tlb, ptep, address) \
122 tlb->need_flush = 1; \
123 __tlb_remove_tlb_entry(tlb, ptep, address); \
126 #define pte_free_tlb(tlb, ptep) \
128 tlb->need_flush = 1; \
129 __pte_free_tlb(tlb, ptep); \
133 #define pud_free_tlb(tlb, pudp) \
135 tlb->need_flush = 1; \
136 __pud_free_tlb(tlb, pudp); \
140 #define pmd_free_tlb(tlb, pmdp) \
142 tlb->need_flush = 1; \
143 __pmd_free_tlb(tlb, pmdp); \