Lines Matching defs:fbatch
50 /* Protecting only lru_rotate.fbatch which requires disabling interrupts */
53 struct folio_batch fbatch;
203 static void folio_batch_move_lru(struct folio_batch *fbatch, move_fn_t move_fn)
209 for (i = 0; i < folio_batch_count(fbatch); i++) {
210 struct folio *folio = fbatch->folios[i];
224 folios_put(fbatch->folios, folio_batch_count(fbatch));
225 folio_batch_reinit(fbatch);
228 static void folio_batch_add_and_move(struct folio_batch *fbatch,
231 if (folio_batch_add(fbatch, folio) && !folio_test_large(folio) &&
234 folio_batch_move_lru(fbatch, move_fn);
258 struct folio_batch *fbatch;
263 fbatch = this_cpu_ptr(&lru_rotate.fbatch);
264 folio_batch_add_and_move(fbatch, folio, lru_move_tail_fn);
353 struct folio_batch *fbatch = &per_cpu(cpu_fbatches.activate, cpu);
355 if (folio_batch_count(fbatch))
356 folio_batch_move_lru(fbatch, folio_activate_fn);
363 struct folio_batch *fbatch;
367 fbatch = this_cpu_ptr(&cpu_fbatches.activate);
368 folio_batch_add_and_move(fbatch, folio, folio_activate_fn);
393 struct folio_batch *fbatch;
397 fbatch = this_cpu_ptr(&cpu_fbatches.lru_add);
409 for (i = folio_batch_count(fbatch) - 1; i >= 0; i--) {
410 struct folio *batch_folio = fbatch->folios[i];
510 struct folio_batch *fbatch;
523 fbatch = this_cpu_ptr(&cpu_fbatches.lru_add);
524 folio_batch_add_and_move(fbatch, folio, lru_add_fn);
656 struct folio_batch *fbatch = &fbatches->lru_add;
658 if (folio_batch_count(fbatch))
659 folio_batch_move_lru(fbatch, lru_add_fn);
661 fbatch = &per_cpu(lru_rotate.fbatch, cpu);
663 if (data_race(folio_batch_count(fbatch))) {
668 folio_batch_move_lru(fbatch, lru_move_tail_fn);
672 fbatch = &fbatches->lru_deactivate_file;
673 if (folio_batch_count(fbatch))
674 folio_batch_move_lru(fbatch, lru_deactivate_file_fn);
676 fbatch = &fbatches->lru_deactivate;
677 if (folio_batch_count(fbatch))
678 folio_batch_move_lru(fbatch, lru_deactivate_fn);
680 fbatch = &fbatches->lru_lazyfree;
681 if (folio_batch_count(fbatch))
682 folio_batch_move_lru(fbatch, lru_lazyfree_fn);
699 struct folio_batch *fbatch;
707 fbatch = this_cpu_ptr(&cpu_fbatches.lru_deactivate_file);
708 folio_batch_add_and_move(fbatch, folio, lru_deactivate_file_fn);
724 struct folio_batch *fbatch;
728 fbatch = this_cpu_ptr(&cpu_fbatches.lru_deactivate);
729 folio_batch_add_and_move(fbatch, folio, lru_deactivate_fn);
746 struct folio_batch *fbatch;
750 fbatch = this_cpu_ptr(&cpu_fbatches.lru_lazyfree);
751 folio_batch_add_and_move(fbatch, folio, lru_lazyfree_fn);
803 data_race(folio_batch_count(&per_cpu(lru_rotate.fbatch, cpu))) ||
1063 void __folio_batch_release(struct folio_batch *fbatch)
1065 if (!fbatch->percpu_pvec_drained) {
1067 fbatch->percpu_pvec_drained = true;
1069 release_pages(fbatch->folios, folio_batch_count(fbatch));
1070 folio_batch_reinit(fbatch);
1076 * @fbatch: The batch to prune
1079 * entries. This function prunes all the non-folio entries from @fbatch
1083 void folio_batch_remove_exceptionals(struct folio_batch *fbatch)
1087 for (i = 0, j = 0; i < folio_batch_count(fbatch); i++) {
1088 struct folio *folio = fbatch->folios[i];
1090 fbatch->folios[j++] = folio;
1092 fbatch->nr = j;