folio_move_anon_rmap(9)
π folio_move_anon_rmap(9) π
okay so bestie, welcome to the Kernel API Manual β yes, the Kernel API Manual, we're doing kernel internals today and honestly? kind of iconic of us. this page is about folio_move_anon_rmap, and no cap, it's a little one-pager with a big glow-up energy. let's get into it β¨
π NAME π
folio_move_anon_rmap β move a folio to our anon_vma π«Ά
like, it's literally right there in the name. we're moving a folio. it's becoming ours. main character move.
πΈ SYNOPSIS πΈ
void folio_move_anon_rmap (struct folio *folio , struct vm_area_struct
*vma );
no return value, no drama, just vibes and two arguments. periodt π
π¦ ARGUMENTS π¦
folioβ The folio to move to our anon_vma. this is the lil guy we're relocating. it's coming home with us πvmaβ The vma the folio belongs to. gotta know which vma it's repping, iykyk.
π DESCRIPTION π
okay so here's the tea β β when a folio belongs exclusively to one single process after a COW event (yes, copy-on-write, we know her), that folio is free to be moved into the anon_vma that belongs to just that one process. just. that. process.
the way that this works is genuinely so satisfying: because the folio is now living its solo era in that process's own anon_vma, the rmap code will not search the parent or sibling processes anymore. no more scrolling through the whole family group chat. it goes straight to the one person it needs. efficiency slay π₯
lowkey important: this is a post-COW-exclusive situation only β the whole point is that nobody else is sharing it anymore. that's the vibe check that makes the move valid π―
β SEE ALSO β
everything below lives in the kernel file ./mm/rmap.c and honestly it's giving rmap extended universe π:
__anon_vma_prepare(9)anon_vma_clone(9)unlink_anon_vmas(9)page_address_in_vma(9)folio_referenced(9)mapping_wrprotect_range(9)pfn_mkclean_range(9)__folio_set_anon(9)__page_check_anon_rmap(9)folio_add_anon_rmap_ptes(9)folio_add_anon_rmap_pmd(9)folio_add_new_anon_rmap(9)folio_add_file_rmap_ptes(9)folio_add_file_rmap_pmd(9)folio_add_file_rmap_pud(9)folio_remove_rmap_ptes(9)folio_remove_rmap_pmd(9)folio_remove_rmap_pud(9)try_to_unmap(9)try_to_migrate(9)make_device_exclusive(9)__rmap_walk_file(9)
go read those too bestie, they're all in ./mm/rmap.c, they're all waiting π§
π· the cute sign-off π·
this lil masterpiece comes from the source ./mm, dated October 2026 β mark your calendars, screenshot it, put it in the group chat. and that's the whole page, bestie. you ate. we ate. the folio is home. πβ¨ππ¦
π¦ 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