gen_pool_set_algo(9)
π gen_pool_set_algo β like, the manual page bestie
okay so this is gen_pool_set_algo(9) from the Kernel API Manual β¨ β yes, that's the same name as the title, we're not being subtle, it's the function and it's the main character. Scroll down and I'll tell you everything π«Ά
πΈ NAME
gen_pool_set_algo β set the allocation algorithm π«
That's it. That's the whole vibe. You're swapping out how this pool picks a chunk. Iconic behavior, honestly.
β¨ SYNOPSIS
void gen_pool_set_algo (struct gen_pool *pool , genpool_algo_t algo ,
void *data );
Like, it takes three things and gives you nothing back β void return, no notes, no drama, it just does the thing π
(spoiler: nothing gets returned, don't @ me, that's literally what the synopsis says)
π ARGUMENTS
poolβ the pool you're changing the allocation algorithm on. Your girl. Your project. πΈalgoβ a custom algorithm function. That's the whole point, bestie, this is the function you're installing π₯dataβ additional data used byalgo. Extra stuff it needs. It gets handed over to your algo, iykyk β¨
π¦ DESCRIPTION
okay so here's the tea β: this calls algo for each memory allocation in the pool. Every single one. No skipping, no shortcuts, no "ugh not this one again" π
And if algo is NULL? No worries β it uses gen_pool_first_fit as the default memory allocation function π so you literally cannot break it by passing nothing. It's got a backup plan. Lowkey so thoughtful of it π«Ά
ngl, this is the "change the strategy mid-game" move. The pool keeps on pooling, it just pools differently now π«
π SEE ALSO
Kernel file ./lib/genalloc.c π β that's where the real magic lives, go look:
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_first_fit(9), gen_pool_first_fit_align(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)
the whole friend group, fr fr π
that's the page, bestie π this one comes from the source directory ./lib, dated October 2026 β stay hydrated, keep your pools aligned, and slay β¨π
π
π¦ 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