Lines Matching refs:batch
20 struct mmu_gather_batch *batch; in tlb_next_batch() local
22 batch = tlb->active; in tlb_next_batch()
23 if (batch->next) { in tlb_next_batch()
24 tlb->active = batch->next; in tlb_next_batch()
31 batch = (void *)__get_free_pages(GFP_NOWAIT | __GFP_NOWARN, 0); in tlb_next_batch()
32 if (!batch) in tlb_next_batch()
36 batch->next = NULL; in tlb_next_batch()
37 batch->nr = 0; in tlb_next_batch()
38 batch->max = MAX_GATHER_BATCH; in tlb_next_batch()
40 tlb->active->next = batch; in tlb_next_batch()
41 tlb->active = batch; in tlb_next_batch()
48 struct mmu_gather_batch *batch; in tlb_batch_pages_flush() local
50 for (batch = &tlb->local; batch && batch->nr; batch = batch->next) { in tlb_batch_pages_flush()
51 struct page **pages = batch->pages; in tlb_batch_pages_flush()
57 unsigned int nr = min(512U, batch->nr); in tlb_batch_pages_flush()
61 batch->nr -= nr; in tlb_batch_pages_flush()
64 } while (batch->nr); in tlb_batch_pages_flush()
71 struct mmu_gather_batch *batch, *next; in tlb_batch_list_free() local
73 for (batch = tlb->local.next; batch; batch = next) { in tlb_batch_list_free()
74 next = batch->next; in tlb_batch_list_free()
75 free_pages((unsigned long)batch, 0); in tlb_batch_list_free()
82 struct mmu_gather_batch *batch; in __tlb_remove_page_size() local
90 batch = tlb->active; in __tlb_remove_page_size()
95 batch->pages[batch->nr++] = page; in __tlb_remove_page_size()
96 if (batch->nr == batch->max) { in __tlb_remove_page_size()
99 batch = tlb->active; in __tlb_remove_page_size()
101 VM_BUG_ON_PAGE(batch->nr > batch->max, page); in __tlb_remove_page_size()
110 static void __tlb_remove_table_free(struct mmu_table_batch *batch) in __tlb_remove_table_free() argument
114 for (i = 0; i < batch->nr; i++) in __tlb_remove_table_free()
115 __tlb_remove_table(batch->tables[i]); in __tlb_remove_table_free()
117 free_page((unsigned long)batch); in __tlb_remove_table_free()
173 static void tlb_remove_table_free(struct mmu_table_batch *batch) in tlb_remove_table_free() argument
175 call_rcu(&batch->rcu, tlb_remove_table_rcu); in tlb_remove_table_free()
180 static void tlb_remove_table_free(struct mmu_table_batch *batch) in tlb_remove_table_free() argument
182 __tlb_remove_table_free(batch); in tlb_remove_table_free()
210 struct mmu_table_batch **batch = &tlb->batch; in tlb_table_flush() local
212 if (*batch) { in tlb_table_flush()
214 tlb_remove_table_free(*batch); in tlb_table_flush()
215 *batch = NULL; in tlb_table_flush()
221 struct mmu_table_batch **batch = &tlb->batch; in tlb_remove_table() local
223 if (*batch == NULL) { in tlb_remove_table()
224 *batch = (struct mmu_table_batch *)__get_free_page(GFP_NOWAIT | __GFP_NOWARN); in tlb_remove_table()
225 if (*batch == NULL) { in tlb_remove_table()
230 (*batch)->nr = 0; in tlb_remove_table()
233 (*batch)->tables[(*batch)->nr++] = table; in tlb_remove_table()
234 if ((*batch)->nr == MAX_TABLE_BATCH) in tlb_remove_table()
240 tlb->batch = NULL; in tlb_table_init()