Lines Matching refs:batch
185 struct mmu_gather_batch *batch; in tlb_next_batch() local
187 batch = tlb->active; in tlb_next_batch()
188 if (batch->next) { in tlb_next_batch()
189 tlb->active = batch->next; in tlb_next_batch()
196 batch = (void *)__get_free_pages(GFP_NOWAIT | __GFP_NOWARN, 0); in tlb_next_batch()
197 if (!batch) in tlb_next_batch()
201 batch->next = NULL; in tlb_next_batch()
202 batch->nr = 0; in tlb_next_batch()
203 batch->max = MAX_GATHER_BATCH; in tlb_next_batch()
205 tlb->active->next = batch; in tlb_next_batch()
206 tlb->active = batch; in tlb_next_batch()
230 tlb->batch = NULL; in tlb_gather_mmu()
251 struct mmu_gather_batch *batch; in tlb_flush_mmu_free() local
253 for (batch = &tlb->local; batch && batch->nr; batch = batch->next) { in tlb_flush_mmu_free()
254 free_pages_and_swap_cache(batch->pages, batch->nr); in tlb_flush_mmu_free()
255 batch->nr = 0; in tlb_flush_mmu_free()
272 struct mmu_gather_batch *batch, *next; in tlb_finish_mmu() local
279 for (batch = tlb->local.next; batch; batch = next) { in tlb_finish_mmu()
280 next = batch->next; in tlb_finish_mmu()
281 free_pages((unsigned long)batch, 0); in tlb_finish_mmu()
294 struct mmu_gather_batch *batch; in __tlb_remove_page() local
298 batch = tlb->active; in __tlb_remove_page()
299 batch->pages[batch->nr++] = page; in __tlb_remove_page()
300 if (batch->nr == batch->max) { in __tlb_remove_page()
303 batch = tlb->active; in __tlb_remove_page()
305 VM_BUG_ON_PAGE(batch->nr > batch->max, page); in __tlb_remove_page()
307 return batch->max - batch->nr; in __tlb_remove_page()
338 struct mmu_table_batch *batch; in tlb_remove_table_rcu() local
341 batch = container_of(head, struct mmu_table_batch, rcu); in tlb_remove_table_rcu()
343 for (i = 0; i < batch->nr; i++) in tlb_remove_table_rcu()
344 __tlb_remove_table(batch->tables[i]); in tlb_remove_table_rcu()
346 free_page((unsigned long)batch); in tlb_remove_table_rcu()
351 struct mmu_table_batch **batch = &tlb->batch; in tlb_table_flush() local
353 if (*batch) { in tlb_table_flush()
354 call_rcu_sched(&(*batch)->rcu, tlb_remove_table_rcu); in tlb_table_flush()
355 *batch = NULL; in tlb_table_flush()
361 struct mmu_table_batch **batch = &tlb->batch; in tlb_remove_table() local
372 if (*batch == NULL) { in tlb_remove_table()
373 *batch = (struct mmu_table_batch *)__get_free_page(GFP_NOWAIT | __GFP_NOWARN); in tlb_remove_table()
374 if (*batch == NULL) { in tlb_remove_table()
378 (*batch)->nr = 0; in tlb_remove_table()
380 (*batch)->tables[(*batch)->nr++] = table; in tlb_remove_table()
381 if ((*batch)->nr == MAX_TABLE_BATCH) in tlb_remove_table()