devm_free_pages(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 β€” the struct device that 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:


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