gen_pool_best_fit(9)
π 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 bitsstartβ the bitnumber where the searching begins, like your starting position in a group chat scrollnrβ 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 fromstart_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 π«Ά:
gen_pool_create(9)gen_pool_add_owner(9)gen_pool_virt_to_phys(9)gen_pool_destroy(9)gen_pool_alloc_algo_owner(9)gen_pool_dma_alloc(9)gen_pool_dma_alloc_algo(9)gen_pool_dma_alloc_align(9)gen_pool_dma_zalloc(9)gen_pool_dma_zalloc_algo(9)gen_pool_dma_zalloc_align(9)gen_pool_free_owner(9)gen_pool_for_each_chunk(9)gen_pool_has_addr(9)gen_pool_avail(9)gen_pool_size(9)gen_pool_set_algo(9)gen_pool_first_fit(9)gen_pool_first_fit_align(9)gen_pool_fixed_alloc(9)gen_pool_first_fit_order_align(9)gen_pool_get(9)devm_gen_pool_create(9)of_gen_pool_get(9)
π 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
- 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