slab_folio(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 ⭐

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