gen_pool_first_fit_align(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… gen_pool_first_fit_align(9) β€” aka the Kernel API Manual glow-up

okay so bestie, buckle up, we're in the Kernel API Manual today and this one's a lib/genalloc.c baddie πŸŽ€ she's the allocator's little matchmaker: she finds the first available region of memory that actually matches the size requirement β€” and yes, the alignment constraint too, she's not gonna set you up with someone who doesn't align πŸ’…


✨ NAME ✨

gen_pool_first_fit_align β€” find the first available region of memory matching the size requirement (alignment constraint) 🌸

Like, that's literally her whole job. No notes. Periodt.


πŸ¦‹ SYNOPSIS πŸ¦‹

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

πŸ’– ARGUMENTS πŸ’–

seven args, bestie, and every single one is doing main character energy in her own way:

  • map β€” the address you're basing the search on πŸ” that's the starting vibe
  • size β€” the bitmap size in bits, so she knows how much map she's working with
  • start β€” the bitnumber to start searching at, like literally where the search begins ✨
  • nr β€” the number of zeroed bits we're looking for 🫢 that's the prize
  • data β€” the data for alignment πŸ‘‘ the alignment deets live here
  • pool β€” the pool to get the order from 🧚 she's gotta know the order, obviously
  • start_addr β€” start addr of alloction chunk πŸ’€ (yes that's spelled like that in the original, and yes I'm keeping it, no cap β€” character for character, we don't edit the source)

🌈 SEE ALSO 🌈

Kernel file ./lib/genalloc.c β€” go say hi to the whole friend group over there, they're all iconic:

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_fixed_alloc(9), gen_pool_first_fit_order_align(9), gen_pool_best_fit(9), gen_pool_get(9), devm_gen_pool_create(9), of_gen_pool_get(9)

fr fr, that's the whole squad πŸ’œ


bestie reminder: first_fit_align is first fit β€” she takes the earliest match that satisfies the size and alignment. She is not out here hunting for the best one, that's a different girl (gen_pool_best_fit, iykyk). πŸ“

okay that's the page!! written in the ./lib directory vibe, dated October 2026 β€” so this manual entry is basically from the future, which is very her πŸ‘‘βœ¨ slay, go allocate something responsibly, mwah πŸŽ€πŸ’…

πŸ“¦ where this page comes from