pagetable_free(9)
π pagetable_free(9) β from the Kernel API Manual π
okay so bestie, welcome to the pagetable_free(9) page β¨ this one is from the Kernel API Manual and honestly? it's short, it's sweet, it does exactly one thing and it does it flawlessly. main character energy fr fr π
πΈ NAME πΈ
pagetable_free β free pagetables, that's it, that's the vibe π
β¨ SYNOPSIS β¨
void pagetable_free (struct ptdesc *pt );
no return value, no drama, just vibes and liberation π¦
π ARGUMENTS π
ptβ the page table descriptor π like, this is the lil struct that tells the function which pagetables we're saying bye to. she's the blueprint, she's the moment.
π DESCRIPTION π
okay so here's the tea β pagetable_free frees the memory of all the page tables described by a page table descriptor β every single one β and it frees the memory for the descriptor itself too. so it's not just clearing out the pagetables, it's also yeeting the descriptor into the void. two-for-one liberation, we love to see it π
β¨
like it literally takes the descriptor and goes "you, your whole squad, and your little struct too β out." iconic behavior, no notes π«Ά
π¦ SEE ALSO π¦
bestie there are so many friends in this lineup, the whole kernel friend group showed up π all of these live in the kernel file ./include/linux/mm.h:
folio_page_idx(9),vma_flag_t(9),fault_flag_allow_retry_first(9),vma_kernel_pagesize(9)πfolio_order(9),folio_reset_order(9),folio_mapcount(9),folio_mapped(9),thp_order(9),thp_size(9)βfolio_get(9),folio_put(9),folio_put_refs(9),folios_put(9)π (the whole get/put family reunion, they're always together iykyk)vma_flags_is_cow_mapping(9),vma_is_cow_mapping(9),vma_desc_is_cow_mapping(9)πfolio_pfn(9),folio_mk_pte(9),folio_mk_pmd(9),folio_mk_pud(9)π₯folio_maybe_dma_pinned(9),is_zero_page(9),is_zero_folio(9)πΈfolio_nr_pages(9),folio_next(9),folio_shift(9),folio_size(9)πfolio_maybe_mapped_shared(9),folio_expected_ref_count(9)πzap_vma(9),ptdesc_address(9),ptdesc_set_kernel(9),ptdesc_clear_kernel(9),ptdesc_test_kernel(9)β‘pagetable_alloc(9)π (the other half of this love story, honestly)vma_lookup(9),vma_start_pgoff(9),vma_end_pgoff(9),vma_last_pgoff(9)π¦vma_start_anon_pgoff(9),vma_end_anon_pgoff(9),vma_last_anon_pgoff(9)πmmap_action_remap(9),mmap_action_remap_full(9),mmap_action_ioremap(9),mmap_action_ioremap_full(9),mmap_action_simple_ioremap(9)πmmap_action_map_kernel_pages(9),mmap_action_map_kernel_pages_full(9)π§range_is_subset(9),range_in_vma(9),range_in_vma_desc(9)πclear_pages(9)β¨
like, that's the whole group chat, no cap π
reminder bestie: this page frees the memory of all page tables described by the descriptor and the descriptor's own memory. don't go touching that descriptor after, that's giving undefined behavior energy and we don't do that here π
okay that's the whole page, you ate that π«Άβ¨ and yeah β this came out of ./include/linux, dated October 2026 β she's fresh, she's documented, she's literally perfect π
ππ
π¦ 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