gen_pool_alloc(9)
π NAME π
gen_pool_alloc β allocate special memory from the pool, bestie β¨
So yeah, this is the Kernel API Manual entry for our girl gen_pool_alloc(9), and she's literally the one you call when you need to pull special memory out of a pool π«Ά
πΈ SYNOPSIS πΈ
unsigned long gen_pool_alloc (struct gen_pool *pool , size_t size );
That's the whole vibe. Two args, one unsigned long coming back at you π
π ARGUMENTS π
poolβ the pool you're allocating from, iykyk πββοΈsizeβ the number of bytes you want allocated out of the pool, fr fr
π¦ DESCRIPTION π¦
Okay so here's the tea β: gen_pool_alloc allocates the requested number of bytes from the specified pool. That's it, that's the job, and she ate π₯
It uses the pool allocation function β with the first-fit algorithm by default β which is a whole thing you should know about before you go poking at pool internals π
β οΈ Important caveat, no cap: this function can not be used in an NMI handler on architectures without an NMI-safe cmpxchg implementation. Like, literally cannot. Don't try it, bestie, that's not the moment for main character energy ππ
π SEE ALSO π
- Kernel file
./include/linux/genalloc.handgenpool_algo_t(9)β go read these, they're iconic π gen_pool_add(9)β the sibling function, she's also slaying
And that's a wrap, bestie! This little gem lives over in ./include/linux β the October 2026 edition, mwah ππβ¨ππ¦πΈπ
π«Ά
π¦ 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