Lines Matching defs:batch
20 struct mmu_gather_batch *batch;
26 batch = tlb->active;
27 if (batch->next) {
28 tlb->active = batch->next;
35 batch = (void *)__get_free_page(GFP_NOWAIT | __GFP_NOWARN);
36 if (!batch)
40 batch->next = NULL;
41 batch->nr = 0;
42 batch->max = MAX_GATHER_BATCH;
44 tlb->active->next = batch;
45 tlb->active = batch;
51 static void tlb_flush_rmap_batch(struct mmu_gather_batch *batch, struct vm_area_struct *vma)
53 for (int i = 0; i < batch->nr; i++) {
54 struct encoded_page *enc = batch->encoded_pages[i];
70 * we only need to walk through the current active batch and the
87 struct mmu_gather_batch *batch;
89 for (batch = &tlb->local; batch && batch->nr; batch = batch->next) {
90 struct encoded_page **pages = batch->encoded_pages;
94 * limit free batch count when PAGE_SIZE > 4K
96 unsigned int nr = min(512U, batch->nr);
100 batch->nr -= nr;
103 } while (batch->nr);
110 struct mmu_gather_batch *batch, *next;
112 for (batch = tlb->local.next; batch; batch = next) {
113 next = batch->next;
114 free_pages((unsigned long)batch, 0);
121 struct mmu_gather_batch *batch;
129 batch = tlb->active;
134 batch->encoded_pages[batch->nr++] = page;
135 if (batch->nr == batch->max) {
138 batch = tlb->active;
140 VM_BUG_ON_PAGE(batch->nr > batch->max, encoded_page_ptr(page));
149 static void __tlb_remove_table_free(struct mmu_table_batch *batch)
153 for (i = 0; i < batch->nr; i++)
154 __tlb_remove_table(batch->tables[i]);
156 free_page((unsigned long)batch);
179 * What we do is batch the freed directory pages (tables) and RCU free them.
183 * However, in order to batch these pages we need to allocate storage, this
212 static void tlb_remove_table_free(struct mmu_table_batch *batch)
214 call_rcu(&batch->rcu, tlb_remove_table_rcu);
219 static void tlb_remove_table_free(struct mmu_table_batch *batch)
221 __tlb_remove_table_free(batch);
249 struct mmu_table_batch **batch = &tlb->batch;
251 if (*batch) {
253 tlb_remove_table_free(*batch);
254 *batch = NULL;
260 struct mmu_table_batch **batch = &tlb->batch;
262 if (*batch == NULL) {
263 *batch = (struct mmu_table_batch *)__get_free_page(GFP_NOWAIT | __GFP_NOWARN);
264 if (*batch == NULL) {
269 (*batch)->nr = 0;
272 (*batch)->tables[(*batch)->nr++] = table;
273 if ((*batch)->nr == MAX_TABLE_BATCH)
279 tlb->batch = NULL;