devm_gen_pool_create(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– devm_gen_pool_create(9) β€” kernel API manual energy πŸ’–

okay so bestie, buckle up, because this one is a managed pool situation and honestly it's giving main character energy ✨ This page lives in the kernel API manual, and the function itself is devm_gen_pool_create πŸŽ€


🌸 NAME 🌸

devm_gen_pool_create β€” the managed version of gen_pool_create, no cap πŸ’…


✨ SYNOPSIS ✨

struct gen_pool * devm_gen_pool_create (struct device *dev , int
min_alloc_order , int nid , const char *name );

literally just copy that signature into your code and you're off 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • dev β€” the device that provides the gen_pool. it's the whole reason this is "managed", so don't skip it πŸ™ˆ
  • min_alloc_order β€” log base 2 of the number of bytes each bitmap bit represents. yes, log base 2. yes, it's math. you got this πŸ’œ
  • nid β€” the node selector for the allocated gen_pool. if you want all the nodes, pass NUMA_NO_NODE and let it vibe everywhere 🌈
  • name β€” the name of a gen_pool, or NULL. it identifies a particular gen_pool on the device, so it's basically the pool's little nametag πŸŽ€

πŸ”₯ DESCRIPTION πŸ”₯

So what it does: it creates a brand-new special memory pool, like, a pool specifically for managing special purpose memory β€” the kind of memory that the regular kmalloc/kfree interface just does not manage 😀 iconic behavior honestly.

and here's the bestie part: the pool is automatically destroyed by the device management code. you don't have to clean up after it. it manages itself. self-care queen πŸ’…βœ¨


πŸ‘‘ SEE ALSO πŸ‘‘

kernel file ./lib/genalloc.c has all the lore, and here's the whole friend group (iykyk) 🌸:


πŸ’€ reminder bestie: min_alloc_order is log base 2 of bytes per bitmap bit. do not just throw a random number in there and hope. that's not slay, that's a bug.

and that's the page!! 🧚 this little gem comes from ./lib, dated October 2026, and it's filed under devm_gen_pool_create(9) β€” go forth and manage your pools, you absolute icon πŸ‘‘πŸ’–

πŸ“¦ where this page comes from