SLAB_ACCOUNT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… SLAB_ACCOUNT(9) πŸ’…

okay so real talk, this is a page from the Kernel API Manual (the (9) is giving kernel-internals, very main character of it) and it's about one tiny flag that does a whole lot of heavy lifting. buckle up bestie πŸŽ€


✨ NAME ✨

SLAB_ACCOUNT β€” the flag that makes your slab cache account its allocations to memcg. like, permanently, for everyone. 🫢


🌸 SYNOPSIS 🌸

SLAB_ACCOUNT

that's it. that's the whole synopsis. no arguments, no options, just vibes and one flag name. periodt. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea β˜•: when you set this flag on a cache, all object allocations from that cache get memcg accounted β€” every single one.

and the way that this is different from normal is: it doesn't matter whether __GFP_ACCOUNT is passed or not passed to the individual allocations. it's accounted either way. the cache said what it said. πŸ”₯

like, normally the per-allocation flag is the one calling the shots, but SLAB_ACCOUNT is the overachiever that just handles it at the cache level so you literally cannot forget. iconic behavior, ngl. πŸ‘‘

tiny reminder bestie: this is a cache-wide setting, so it applies to all allocations from this cache, no exceptions, no "but I didn't pass __GFP_ACCOUNT". that's the whole point. 🫑

πŸ’œ SEE ALSO πŸ’œ

grab a snack, this list is long, but every single one is here because the kernel devs said so and we respect them for it πŸ“


okay that's the whole page, go be amazing with your accounting flag πŸ’–

source/version: this lil guy lives in ./include/linux and the page is dated October 2026 β€” so yeah, freshest of the fresh, no cap. πŸŒˆβœ¨πŸŽ€

πŸ“¦ where this page comes from