slab_folio(9)
π slab_folio(9) β the kernel API manual, but make it make sense π
okay bestie, welcome to slab_folio(9), straight out of the Kernel API Manual β¨ this one is short, it's sweet, and it's lowkey a "please don't do it yourself" PSA. let's get into it π«Ά
πΈ NAME πΈ
slab_folio β the folio that got allocated for a slab. that's it, that's the whole vibe π
β¨ SYNOPSIS β¨
slab_folio (s );
one argument, no drama, we love to see it π
π ARGUMENTS π
sβ the slab. the actual slab in question, the main character of this function call π
π¦ DESCRIPTION π¦
okay so here's the lore. slabs are allocated as folios β those bigger chunks that hold all the individual objects inside them β and they're using some fields in the first struct page of the folio. and like, those fields are now accessed by struct slab instead. plot twist, i know π
so sometimes, occasionally, you gotta convert back to a folio, because you need to communicate with the rest of the mm. think of it as switching back to the group-chat language so everyone else can understand you π¬
please use this helper function instead of casting yourself, okay? π₯Ί like genuinely. the implementation may change in the future, and if you hardcoded a cast you're gonna be the one crying about it. this helper is the whole reason we can't have nice things β no wait, it is the nice thing. use it. periodt π
ngl, this is the "trust the abstraction, babe" moment of the mm subsystem π
β SEE ALSO β
- kernel file
./mm/slab.h page_slab(9)slab_page(9)
go read those too, iykyk π
and that's the whole page, bestie!! π courtesy of the Kernel API Manual, sourced from ./mm, dated October 2026 β genuinely iconic energy, no cap ππ§β¨
π¦ 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