page_slab(9)
π page_slab(9) β the Kernel API Manual, bestie edition β¨
okay so real talk: this is page_slab(9) from the Kernel API Manual, and it's literally the glow-up translator between struct page and struct slab. it's giving "who dis" energy but for kernel memory. π¦
β¨ SYNOPSIS β¨
struct slab * page_slab (const struct page *page );
one function, one job, no cap.
π ARGUMENTS π
pageβ a page which may or may not belong to a slab. like, it's not committed yet, okay? it could be a slab page, it could be a random page living its best life. we don't know until we ask. π
π₯ RETURN π₯
so here's the tea: you get back the slab which contains this page, or NULL if the page does not belong to a slab. π
and yes, that NULL case is important β it includes pages returned from large kmalloc. so if you got a big kmalloc allocation back, don't go assuming it's a slab page, bestie, because it's not. NULL is the vibe check telling you "not for you, girl." π
π«Ά fr fr: always handle the NULL. no cap. that's the whole plot twist.
π SEE ALSO π
- Kernel file
./mm/slab.h slab_folio(9)slab_page(9)
iykyk π
β¨ that's the whole page, mwah β¨ β source dir ./mm, dated October 2026, and the header/footer both literally just say page_slab(9) because the kernel API manual knows exactly who it is ππ
π¦ 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