devm_free_pages(9)
β¨ devm_free_pages(9) β Kernel API Manual β¨
okay so you're in the devm_free_pages(9) page, bestie, welcome to the resource-managed side of the kernel π
this is the manual page, and it's short and sweet β let's get into it π
πΈ NAME πΈ
devm_free_pages β the resource-managed version of free_pages, no cap π«Ά
π SYNOPSIS π
void devm_free_pages (struct device *dev , unsigned long addr );
like, that's the whole signature. void return, two args, done. iconic behavior honestly β¨
π¦ ARGUMENTS π¦
devβ thestruct devicethat this memory belongs to π it's the device the pages are attached to, so the devres system knows whose stuff this is.addrβ the memory to free πΈ literally just hand over the address and it goes away.
π DESCRIPTION π
so here's the vibe: this frees memory that was allocated with devm_get_free_pages. π₯ and the way that it's different from plain free_pages is genuinely the main character moment here β you do not need to supply the order. π«Ά the managed version already knows, so you just pass the address and let it cook.
no extra bookkeeping from you, no order argument, just free and go π
π SEE ALSO π
okay this list is long but we're doing all of it, no skipping, fr fr π it's all the devres girlies from ./drivers/base/devres.c (kernel file) plus the devm_* allocation fam:
__devres_alloc_node(9)devres_for_each_res(9)devres_free(9)devres_add(9)devres_find(9)devres_get(9)devres_remove(9)devres_destroy(9)devres_release(9)devres_release_all(9)devres_open_group(9)devres_close_group(9)devres_remove_group(9)devres_release_group(9)__devm_add_action(9)devm_remove_action_nowarn(9)devm_release_action(9)devm_kmalloc(9)devm_krealloc(9)devm_kstrdup(9)devm_kstrdup_const(9)devm_kvasprintf(9)devm_kasprintf(9)devm_kfree(9)devm_kmemdup(9)devm_kmemdup_const(9)devm_get_free_pages(9)β the one you paired with, bestie π__devm_alloc_percpu(9)
and that's the page!! π sign-off time: this one lives in ./drivers/base, dated October 2026, and it's devm_free_pages(9) all the way down. go free those pages, you got this π§β¨
π¦ 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