free_pages_exact(9)
π free_pages_exact(9) π
okay bestie, welcome to the kernel API manual β this one's free_pages_exact(9) and it's literally the cleanup queen π. she's the counterpart to alloc_pages_exact(), and honestly? every main character needs their other half. π«Ά
β¨ NAME β¨
free_pages_exact β release memory allocated via alloc_pages_exact()
like, it's the undo button. the "nvm take it back" of the page allocator. π
πΈ SYNOPSIS πΈ
void free_pages_exact (void *virt , size_t size );
no cap, that's the whole signature. two args, zero drama (okay maybe a little drama, it's kernel memory). π
π¦ ARGUMENTS π¦
virtβ the value returned byalloc_pages_exact. like, the exact same pointer you got handed back. don't be out here freelancing with a different one πsizeβ size of allocation, same value as passed toalloc_pages_exact. the same value, bestie. matching set. periodt. β¨
π§ DESCRIPTION π§
Release the memory allocated by a previous call to alloc_pages_exact.
that's it, that's the vibe. you allocated it, now you're giving it back β a full circle moment. it's giving responsible memory management, it's giving no leaks, it's giving icon behavior. π
lowkey important: this frees what alloc_pages_exact() handed you β so pair them up properly, iykyk. π
π₯ SEE ALSO π₯
the whole friend group, in Kernel file ./mm/page_alloc.c:
__get_pfnblock_flags_mask(9)get_pfnblock_bit(9)get_pfnblock_migratetype(9)__set_pfnblock_flags_mask(9)set_pfnblock_bit(9)clear_pfnblock_bit(9)set_pageblock_migratetype(9)__move_freepages_block_isolate(9)__putback_isolated_page(9)__free_pages(9)free_pages(9)alloc_pages_exact(9)alloc_pages_exact_nid(9)nr_free_zone_pages(9)nr_free_buffer_pages(9)find_next_best_node(9)free_reserved_pages(9)setup_per_zone_wmarks(9)__free_contig_range(9)alloc_contig_frozen_range(9)alloc_contig_range(9)alloc_contig_frozen_pages(9)alloc_contig_pages(9)free_contig_frozen_range(9)free_contig_range(9)alloc_pages_nolock(9)
like, it's a whole roster. mingle, bestie. π
and that's the page!! π dropped from ./mm, dated October 2026, signed free_pages_exact(9) β mwah, go free some pages responsibly, love u πβ¨π¦
π¦ 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