gen_pool_alloc_algo_owner(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– gen_pool_alloc_algo_owner(9) πŸ’–

okay so first things first, bestie: this is from the Kernel API Manual, and it's the page for gen_pool_alloc_algo_owner β€” the girlies' fave way to grab some special memory out of a pool ✨


🌸 NAME 🌸

gen_pool_alloc_algo_owner β€” allocate special memory from the pool 🫢


✨ SYNOPSIS ✨

unsigned long gen_pool_alloc_algo_owner (struct gen_pool *pool , size_t
size , genpool_algo_t algo , void *data , void **owner );

Like, that's the whole signature, no cap. Look at her go πŸ”₯


πŸŽ€ ARGUMENTS πŸŽ€

  • pool β€” the pool you're allocating from, bestie. that's your vibe source πŸ’…
  • size β€” how many bytes you want out of the pool. literally the amount, fr fr
  • algo β€” the algorithm, passed in from whoever's calling. your choice, your rules πŸ‘‘
  • data β€” data that gets passed to the algorithm. it's giving "here's some snacks for your algorithm" πŸ“
  • owner β€” optionally retrieve the chunk owner πŸ‘€ yes "optionally", you can skip it if you don't care

πŸ¦‹ DESCRIPTION πŸ¦‹

So basically: allocate the requested number of bytes from the specified pool. She uses the pool allocation function β€” with the first-fit algorithm by default β€” so if you don't pick an algorithm, first-fit is what you're getting, periodt ✨

⚠️ big heads up though: this can not be used in an NMI handler on architectures without an NMI-safe cmpxchg implementation. like, don't do it. that's the rule, ngl 😭

🌈 SEE ALSO 🌈

Kernel file ./lib/genalloc.c β€” and honestly the whole friend group, here's the roll call πŸ’–


πŸ’œ mwah, that's a wrap πŸ’œ

sourced straight from ./lib, and this beauty is dated October 2026 β€” gen_pool_alloc_algo_owner(9), slaying across the timeline πŸ§šβ€β™€οΈ see u in the next manpage bestie 😘

πŸ“¦ where this page comes from