release_pages(9)
β¨ release_pages(9) β¨
okay so bestie, this is a page from the Kernel API Manual β section 9, release_pages(9) β and honestly it's giving "group project cleanup crew" energy π
πΈ NAME πΈ
release_pages β batched put_page() π
like, put_page() but make it a batch, yk? one call, many pages, no chaos β¨
π¦ SYNOPSIS π¦
void release_pages (release_pages_arg arg , int nr );
literally the whole signature, no cap π₯
π ARGUMENTS π
argβ array of pages to release π«Ά like the whole squad of pages you're letting go ofnrβ number of pages π how many of them we're talking about here
π DESCRIPTION π
okay so here's the tea β: this function decrements the reference count on all the pages in arg.
If it fell to zero? bestie, the page is done β it gets removed from the LRU and freed. poof. gone. iconic exit πβ¨
Note that the argument can be an array of pages, encoded pages, or folio pointers. We ignore any encoded bits, and turn any of them into just a folio that gets free'd.
so yeah, whatever flavor of pointer you hand over β plain pages, encoded pages, folios β the encoded bits get yeeted π and everything becomes just a folio that gets free'd. no extra steps, no drama π
π SEE ALSO π
Kernel file ./mm/folio.c β and the whole friend group π
folio_mark_accessed(9)folio_add_lru(9)folio_add_lru_vma(9)deactivate_file_folio(9)folio_mark_lazyfree(9)lru_cache_drain_for_folio(9)folios_put_refs(9)folio_batch_remove_exceptionals(9)
mwah π that's the whole page β from ./mm, dated October 2026. go free some folios bestie, 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