page_slab(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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

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