mempool_alloc_bulk(9)
π mempool_alloc_bulk(9) π
okay so bestie, welcome to the Kernel API Manual β¨ β this one's all about mempool_alloc_bulk, and it's lowkey a vibe. it grabs a whole handful of elements out of a memory pool for you, no cap. π«Ά
β¨ NAME β¨
mempool_alloc_bulk β allocate multiple elements from a memory pool π
πΈ SYNOPSIS πΈ
int mempool_alloc_bulk (struct mempool *pool , void **elems , unsigned int count );
like, that's the whole signature, she's right there π
π¦ ARGUMENTS π¦
poolβ pointer to the memory pool π§ that's your pool, your main characterelemsβ a partially or fully populated elements array π¦ it can show up half-full or fully stacked, either way she's validcountβ the number of entries inelemthat need to be allocated π’ yes bestie, literally how many slots we're filling
π DESCRIPTION π
so here's the tea β β this bad boy allocates count elements into elems.
the way it works is: first it calls into the alloc_fn that you supplied back at pool initialization time β¨, and then, when alloc_fn fails to allocate an element (rude of it honestly π), it dips into the reserved pool instead. like a backup bestie. π
on return, all count elements in elems will be populated π every single one. fully seated. no empty chairs at this table. π₯
β RETURN β
always 0. that's it. that's the whole return value. π«Ά
fun fact: if it wasn't for%$#^$alloc tags, it would returnvoid. instead it returns0and we all just live with that π
π SEE ALSO π
kernel file ./mm/mempool.c β go read her, she's iconic π
mempool_exit(9)mempool_destroy(9)mempool_init(9)mempool_create_node(9)mempool_resize(9)mempool_alloc(9)mempool_alloc_preallocated(9)mempool_free_bulk(9)mempool_free(9)
okay and finally, the cute lil sign-off π this whole page lives in ./mm, it's dated October 2026, and yes β mempool_alloc_bulk(9) is the title, she's in the 9 section, periodt. πβ¨π§
π¦ 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