Lines Matching refs:batch

20 	struct mmu_gather_batch *batch;  in tlb_next_batch()  local
26 batch = tlb->active; in tlb_next_batch()
27 if (batch->next) { in tlb_next_batch()
28 tlb->active = batch->next; in tlb_next_batch()
35 batch = (void *)__get_free_page(GFP_NOWAIT | __GFP_NOWARN); in tlb_next_batch()
36 if (!batch) in tlb_next_batch()
40 batch->next = NULL; in tlb_next_batch()
41 batch->nr = 0; in tlb_next_batch()
42 batch->max = MAX_GATHER_BATCH; in tlb_next_batch()
44 tlb->active->next = batch; in tlb_next_batch()
45 tlb->active = batch; in tlb_next_batch()
51 static void tlb_flush_rmap_batch(struct mmu_gather_batch *batch, struct vm_area_struct *vma) in tlb_flush_rmap_batch() argument
53 for (int i = 0; i < batch->nr; i++) { in tlb_flush_rmap_batch()
54 struct encoded_page *enc = batch->encoded_pages[i]; in tlb_flush_rmap_batch()
87 struct mmu_gather_batch *batch; in tlb_batch_pages_flush() local
89 for (batch = &tlb->local; batch && batch->nr; batch = batch->next) { in tlb_batch_pages_flush()
90 struct encoded_page **pages = batch->encoded_pages; in tlb_batch_pages_flush()
96 unsigned int nr = min(512U, batch->nr); in tlb_batch_pages_flush()
100 batch->nr -= nr; in tlb_batch_pages_flush()
103 } while (batch->nr); in tlb_batch_pages_flush()
110 struct mmu_gather_batch *batch, *next; in tlb_batch_list_free() local
112 for (batch = tlb->local.next; batch; batch = next) { in tlb_batch_list_free()
113 next = batch->next; in tlb_batch_list_free()
114 free_pages((unsigned long)batch, 0); in tlb_batch_list_free()
121 struct mmu_gather_batch *batch; in __tlb_remove_page_size() local
129 batch = tlb->active; in __tlb_remove_page_size()
134 batch->encoded_pages[batch->nr++] = page; in __tlb_remove_page_size()
135 if (batch->nr == batch->max) { in __tlb_remove_page_size()
138 batch = tlb->active; in __tlb_remove_page_size()
140 VM_BUG_ON_PAGE(batch->nr > batch->max, encoded_page_ptr(page)); in __tlb_remove_page_size()
149 static void __tlb_remove_table_free(struct mmu_table_batch *batch) in __tlb_remove_table_free() argument
153 for (i = 0; i < batch->nr; i++) in __tlb_remove_table_free()
154 __tlb_remove_table(batch->tables[i]); in __tlb_remove_table_free()
156 free_page((unsigned long)batch); in __tlb_remove_table_free()
212 static void tlb_remove_table_free(struct mmu_table_batch *batch) in tlb_remove_table_free() argument
214 call_rcu(&batch->rcu, tlb_remove_table_rcu); in tlb_remove_table_free()
219 static void tlb_remove_table_free(struct mmu_table_batch *batch) in tlb_remove_table_free() argument
221 __tlb_remove_table_free(batch); in tlb_remove_table_free()
249 struct mmu_table_batch **batch = &tlb->batch; in tlb_table_flush() local
251 if (*batch) { in tlb_table_flush()
253 tlb_remove_table_free(*batch); in tlb_table_flush()
254 *batch = NULL; in tlb_table_flush()
260 struct mmu_table_batch **batch = &tlb->batch; in tlb_remove_table() local
262 if (*batch == NULL) { in tlb_remove_table()
263 *batch = (struct mmu_table_batch *)__get_free_page(GFP_NOWAIT | __GFP_NOWARN); in tlb_remove_table()
264 if (*batch == NULL) { in tlb_remove_table()
269 (*batch)->nr = 0; in tlb_remove_table()
272 (*batch)->tables[(*batch)->nr++] = table; in tlb_remove_table()
273 if ((*batch)->nr == MAX_TABLE_BATCH) in tlb_remove_table()
279 tlb->batch = NULL; in tlb_table_init()