Lines Matching refs:tlb

12 #include <asm/tlb.h>
16 static bool tlb_next_batch(struct mmu_gather *tlb)
20 batch = tlb->active;
22 tlb->active = batch->next;
26 if (tlb->batch_count == MAX_GATHER_BATCH_COUNT)
33 tlb->batch_count++;
38 tlb->active->next = batch;
39 tlb->active = batch;
44 static void tlb_batch_pages_flush(struct mmu_gather *tlb)
48 for (batch = &tlb->local; batch && batch->nr; batch = batch->next) {
52 tlb->active = &tlb->local;
55 static void tlb_batch_list_free(struct mmu_gather *tlb)
59 for (batch = tlb->local.next; batch; batch = next) {
63 tlb->local.next = NULL;
66 bool __tlb_remove_page_size(struct mmu_gather *tlb, struct page *page, int page_size)
70 VM_BUG_ON(!tlb->end);
73 VM_WARN_ON(tlb->page_size != page_size);
76 batch = tlb->active;
83 if (!tlb_next_batch(tlb))
85 batch = tlb->active;
176 static inline void tlb_table_invalidate(struct mmu_gather *tlb)
184 tlb_flush_mmu_tlbonly(tlb);
194 static void tlb_table_flush(struct mmu_gather *tlb)
196 struct mmu_table_batch **batch = &tlb->batch;
199 tlb_table_invalidate(tlb);
205 void tlb_remove_table(struct mmu_gather *tlb, void *table)
207 struct mmu_table_batch **batch = &tlb->batch;
212 tlb_table_invalidate(tlb);
221 tlb_table_flush(tlb);
224 static inline void tlb_table_init(struct mmu_gather *tlb)
226 tlb->batch = NULL;
231 static inline void tlb_table_flush(struct mmu_gather *tlb) { }
232 static inline void tlb_table_init(struct mmu_gather *tlb) { }
236 static void tlb_flush_mmu_free(struct mmu_gather *tlb)
238 tlb_table_flush(tlb);
240 tlb_batch_pages_flush(tlb);
244 void tlb_flush_mmu(struct mmu_gather *tlb)
246 tlb_flush_mmu_tlbonly(tlb);
247 tlb_flush_mmu_free(tlb);
252 * @tlb: the mmu_gather structure to initialize
262 void tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm,
265 tlb->mm = mm;
268 tlb->fullmm = !(start | (end+1));
271 tlb->need_flush_all = 0;
272 tlb->local.next = NULL;
273 tlb->local.nr = 0;
274 tlb->local.max = ARRAY_SIZE(tlb->__pages);
275 tlb->active = &tlb->local;
276 tlb->batch_count = 0;
279 tlb_table_init(tlb);
281 tlb->page_size = 0;
284 __tlb_reset_range(tlb);
285 inc_tlb_flush_pending(tlb->mm);
290 * @tlb: the mmu_gather structure to finish
297 void tlb_finish_mmu(struct mmu_gather *tlb,
312 if (mm_tlb_flush_nested(tlb->mm)) {
321 tlb->fullmm = 1;
322 __tlb_reset_range(tlb);
323 tlb->freed_tables = 1;
326 tlb_flush_mmu(tlb);
329 tlb_batch_list_free(tlb);
331 dec_tlb_flush_pending(tlb->mm);