gen_pool_best_fit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… gen_pool_best_fit(9) πŸ’…

Ok so bestie, you know how the manual says this lives under the kernel API manual? Yeah, that's the vibe. Let's get into it. πŸŽ€


✨ NAME ✨

gen_pool_best_fit β€” find the best fitting region of memory matching the size requirement (no alignment constraint) 🧚


🌸 SYNOPSIS 🌸

unsigned long gen_pool_best_fit (unsigned long *map , unsigned long size
, unsigned long start , unsigned int nr , void *data , struct gen_pool
*pool , unsigned long start_addr );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • map β€” the address you're basing the search on, literally the launch pad for this whole hunt πŸ”
  • size β€” the bitmap size, in bits
  • start β€” the bitnumber where the searching begins, like your starting position in a group chat scroll
  • nr β€” the number of zeroed bits we're looking for (this is the size requirement, the whole reason we're here)
  • data β€” additional data, but bestie it's unused, so don't stress πŸ’€
  • pool β€” the pool we're finding the fit region memory from
  • start_addr β€” not used in this function 🫢 (yes, it's in the signature anyway, don't @ me)

πŸ‘‘ DESCRIPTION πŸ‘‘

So what it does is iterate over the bitmap to find the smallest free region that we can allocate the memory in. That's the best fit, that's the whole point, no cap. It's giving "picky but make it efficient." ✨


πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./lib/genalloc.c β€” and here's the whole squad, all of them, every single one, because we don't skip anybody in this house 🫢:


πŸ’– that's a wrap bestie πŸ’– this one's from ./lib, dated October 2026, and the page is gen_pool_best_fit(9) β€” go forth and allocate responsibly, mwah πŸ’…βœ¨

πŸ“¦ where this page comes from