free_pages(9)
π free_pages(9) π
okay so real talk, bestie β you're reading the free_pages page from the Kernel API Manual, and honestly? it's a whole vibe. let's get into it π«Ά
β¨ NAME β¨
free_pages β frees pages that were allocated with __get_free_pages(). that's it, that's the whole job, and she does it beautifully π
π SYNOPSIS π
void free_pages (unsigned long addr , unsigned int order );
look at her. two args. clean. iconic. β¨
πΈ ARGUMENTS πΈ
addrβ the virtual address tied to a page that came back from__get_free_pages. like, the actual address you got handed. don't get cute with it πorderβ the order of the allocation. yes, the same one. you gotta tell her how big the thing was, she's not psychic π
π¦ DESCRIPTION π¦
so free_pages behaves the same as __free_pages β literally same energy, same result. the whole point of this one is: you use it when you only have a valid virtual address. that's your situation? she's your girl. π
but listen β if you've got the page itself (like, the struct page), do not come here. call __free_pages instead. matching the right function to the thing you're actually holding is the whole game, ngl. π₯
π seriously, check what you're holding first. virtual address βfree_pages. page β__free_pages. don't mix them up, bestie.
π SEE ALSO π
kernel file ./mm/page_alloc.c, plus the whole friend group:
__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)alloc_pages_exact(9)alloc_pages_exact_nid(9)free_pages_exact(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, that's the group chat. go say hi π§
mwah π this page came from ./mm, dated October 2026, and it's still signed free_pages(9) β go free responsibly, bestie π
π¦ 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