vmemmap_remap_free(9)
π vmemmap_remap_free(9) π
okay so bestie, welcome to the Kernel API Manual β this is the page for vmemmap_remap_free, and honestly? it's giving "quietly doing the most important cleanup of your life" energy. β¨
πΈ NAME πΈ
vmemmap_remap_free β remap the vmemmap virtual address range [@start, @end) to use @vmemmap_head/@vmemmap_tail, then free vmemmap which the range are mapped to.
like literally, remap the range, then yeet the old vmemmap mapping. both. in one function. icon behaviour. π
π¦ SYNOPSIS π¦
int vmemmap_remap_free (unsigned long start , unsigned long end , struct
page *vmemmap_head , struct page *vmemmap_tail , struct list_head
*vmemmap_pages , unsigned long flags );
she takes six arguments and returns an int. no cap.
π ARGUMENTS π
startβ start address of the vmemmap virtual address range that we want to remap. the beginning. the opening scene. πendβ end address of the vmemmap virtual address range that we want to remap. note the range is[start, end), soendis not included β she's exclusive, as she should be. πvmemmap_headβ the page to be installed as first in the vmemmap range. main character energy, literally first in the range. πvmemmap_tailβ the page to be installed as non-first in the vmemmap range. the supporting cast, but make no mistake, she's still in the range. π«Άvmemmap_pagesβ list to deposit vmemmap pages to be freed. β οΈ it is callers responsibility to free pages β so bestie, this function hands you the pages in a little basket and goes "k, your turn now". do NOT forget to free them. that's on you, not on her. πflagsβ modifications tovmemmap_remap_walkflags. little toggles, big consequences. π₯
β RETURN β
0 on success, negative error code otherwise.
that's it. zero means slay, negative means something's off and you should probably read the code. π
π SEE ALSO π
- Kernel file
./mm/hugetlb_vmemmap.c struct vmemmap_remap_walk(9)vmemmap_remap_split(9)vmemmap_remap_alloc(9)hugetlb_vmemmap_restore_folio(9)hugetlb_vmemmap_restore_folios(9)hugetlb_vmemmap_optimize_folio(9)
the whole friend group honestly. go say hi. π¦
anyway that's the page, bestie β courtesy of ./mm, dated October 2026, and yes she's still signing off as vmemmap_remap_free(9) because consistency is key. mwah. π
π¦ 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