• Home
  • Raw
  • Download

Lines Matching refs:tlb

16 static bool tlb_next_batch(struct mmu_gather *tlb)  in tlb_next_batch()  argument
20 batch = tlb->active; in tlb_next_batch()
22 tlb->active = batch->next; in tlb_next_batch()
26 if (tlb->batch_count == MAX_GATHER_BATCH_COUNT) in tlb_next_batch()
33 tlb->batch_count++; in tlb_next_batch()
38 tlb->active->next = batch; in tlb_next_batch()
39 tlb->active = batch; in tlb_next_batch()
44 static void tlb_batch_pages_flush(struct mmu_gather *tlb) in tlb_batch_pages_flush() argument
48 for (batch = &tlb->local; batch && batch->nr; batch = batch->next) { in tlb_batch_pages_flush()
52 tlb->active = &tlb->local; in tlb_batch_pages_flush()
55 static void tlb_batch_list_free(struct mmu_gather *tlb) in tlb_batch_list_free() argument
59 for (batch = tlb->local.next; batch; batch = next) { in tlb_batch_list_free()
63 tlb->local.next = NULL; in tlb_batch_list_free()
66 bool __tlb_remove_page_size(struct mmu_gather *tlb, struct page *page, int page_size) in __tlb_remove_page_size() argument
70 VM_BUG_ON(!tlb->end); in __tlb_remove_page_size()
73 VM_WARN_ON(tlb->page_size != page_size); in __tlb_remove_page_size()
76 batch = tlb->active; in __tlb_remove_page_size()
83 if (!tlb_next_batch(tlb)) in __tlb_remove_page_size()
85 batch = tlb->active; in __tlb_remove_page_size()
176 static inline void tlb_table_invalidate(struct mmu_gather *tlb) in tlb_table_invalidate() argument
184 tlb_flush_mmu_tlbonly(tlb); in tlb_table_invalidate()
194 static void tlb_table_flush(struct mmu_gather *tlb) in tlb_table_flush() argument
196 struct mmu_table_batch **batch = &tlb->batch; in tlb_table_flush()
199 tlb_table_invalidate(tlb); in tlb_table_flush()
205 void tlb_remove_table(struct mmu_gather *tlb, void *table) in tlb_remove_table() argument
207 struct mmu_table_batch **batch = &tlb->batch; in tlb_remove_table()
212 tlb_table_invalidate(tlb); in tlb_remove_table()
221 tlb_table_flush(tlb); in tlb_remove_table()
224 static inline void tlb_table_init(struct mmu_gather *tlb) in tlb_table_init() argument
226 tlb->batch = NULL; in tlb_table_init()
231 static inline void tlb_table_flush(struct mmu_gather *tlb) { } in tlb_table_flush() argument
232 static inline void tlb_table_init(struct mmu_gather *tlb) { } in tlb_table_init() argument
236 static void tlb_flush_mmu_free(struct mmu_gather *tlb) in tlb_flush_mmu_free() argument
238 tlb_table_flush(tlb); in tlb_flush_mmu_free()
240 tlb_batch_pages_flush(tlb); in tlb_flush_mmu_free()
244 void tlb_flush_mmu(struct mmu_gather *tlb) in tlb_flush_mmu() argument
246 tlb_flush_mmu_tlbonly(tlb); in tlb_flush_mmu()
247 tlb_flush_mmu_free(tlb); in tlb_flush_mmu()
250 static void __tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, in __tlb_gather_mmu() argument
253 tlb->mm = mm; in __tlb_gather_mmu()
254 tlb->fullmm = fullmm; in __tlb_gather_mmu()
257 tlb->need_flush_all = 0; in __tlb_gather_mmu()
258 tlb->local.next = NULL; in __tlb_gather_mmu()
259 tlb->local.nr = 0; in __tlb_gather_mmu()
260 tlb->local.max = ARRAY_SIZE(tlb->__pages); in __tlb_gather_mmu()
261 tlb->active = &tlb->local; in __tlb_gather_mmu()
262 tlb->batch_count = 0; in __tlb_gather_mmu()
265 tlb_table_init(tlb); in __tlb_gather_mmu()
267 tlb->page_size = 0; in __tlb_gather_mmu()
270 __tlb_reset_range(tlb); in __tlb_gather_mmu()
271 inc_tlb_flush_pending(tlb->mm); in __tlb_gather_mmu()
282 void tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm) in tlb_gather_mmu() argument
284 __tlb_gather_mmu(tlb, mm, false); in tlb_gather_mmu()
298 void tlb_gather_mmu_fullmm(struct mmu_gather *tlb, struct mm_struct *mm) in tlb_gather_mmu_fullmm() argument
300 __tlb_gather_mmu(tlb, mm, true); in tlb_gather_mmu_fullmm()
310 void tlb_finish_mmu(struct mmu_gather *tlb) in tlb_finish_mmu() argument
324 if (mm_tlb_flush_nested(tlb->mm)) { in tlb_finish_mmu()
333 tlb->fullmm = 1; in tlb_finish_mmu()
334 __tlb_reset_range(tlb); in tlb_finish_mmu()
335 tlb->freed_tables = 1; in tlb_finish_mmu()
338 tlb_flush_mmu(tlb); in tlb_finish_mmu()
341 tlb_batch_list_free(tlb); in tlb_finish_mmu()
343 dec_tlb_flush_pending(tlb->mm); in tlb_finish_mmu()