STRUCT FOLIO_BATCH(9)
π struct folio_batch(9) β Kernel API Manual π
okay bestie, welcome to section 9 of the Kernel API Manual, and no, we are not gatekeeping today π«Ά today's main character is struct folio_batch, and honestly? it's giving "glorified group chat for folios." let's get into it β¨
π NAME π
struct folio_batch β literally just A collection of folios. that's the whole vibe. a lil squad of folios, hanging out together π
β¨ SYNOPSIS β¨
bestie look at the fit, it's iconic:
struct folio_batch {
unsigned char nr;
unsigned char i;
bool percpu_pvec_drained;
struct folio *folios[FOLIO_BATCH_SIZE];
};
not a single extra character invented, not a single one dropped. slay π
π Members π
okay so the Members section is lowkey just vibes β the manpage doesn't list any members one by one here. no cap, that's it, that's the section. the members are living their truth in the synopsis above π (and if you need the tea on the individual sub-entries of struct folio_batch, that's a you-and-the-struct conversation, not a me-and-the-struct conversation π)
π¦ DESCRIPTION π¦
so the whole point of the folio_batch is to amortise the cost of retrieving and operating on a set of folios. like, instead of doing the expensive lil song-and-dance once per folio, you batch it up and do it for the whole crew at once. efficiency queen π§β¨ expense? amortised. cost? spread out. we love a financially responsible data structure π
the order of folios in the batch may be significant β and here's the receipt: delete_from_page_cache_batch. so do not be out here shuffling the squad like it's a playlist, because sometimes position genuinely matters π
also, some users of the folio_batch store "exceptional" entries in it β the problematic lil divas of the batch, if you will π β and those can be removed by calling folio_batch_remove_exceptionals. so if your batch has drama, there's a whole function for kicking the drama out. periodt πΈ
π₯ SEE ALSO π₯
- Kernel file
./include/linux/folio_batch.hβ the source of truth, the origin story, the sacred text π folio_batch_init(9)folio_batch_add(9)folio_batch_next(9)
iykyk β go read them, they're the supporting cast and they absolutely ate π₯π
π quick reminder: nothing in this page is decorative, so don't come for me if you skipped the FOLIO_BATCH_SIZE in the synopsis β it's real, it's load-bearing, it's in the struct. respect the bracket, bestie.
and that's the whole page! this masterpiece lives in ./include/linux, stamped October 2026, and it's filed as struct folio_batch(9) β go forth and batch responsibly, bestie ππβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms