__folio_set_anon(9)
π __folio_set_anon π
okay so bestie, welcome to __folio_set_anon from the Kernel API Manual, section 9 β yes, the big-leagues kernel-API section, we love that for us π
This one's a void function and it's doing the absolute most important little job ever: it sets up a brand-new anonymous rmap for a folio. That's it. That's the whole vibe. rmap girlies rise π¦
β¨ SYNOPSIS β¨
void __folio_set_anon (struct folio *folio , struct vm_area_struct *vma
, unsigned long address , bool exclusive );
literally four things, no cap. let's break them down π
πΈ ARGUMENTS πΈ
folioβ the folio we're setting up the new anonymous rmap for. it's the main character here, obviously πvmaβ the VM area we're adding that folio to. the venue, if you will πaddressβ the user virtual address of the mapping. iykyk πexclusiveβ aboolthat says whether the folio is exclusive to the process. yes or no, binary queen π
π₯ SEE ALSO π₯
okay these are all in the kernel file ./mm/rmap.c and honestly the friend group is large, so buckle up bestie:
__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_move_anon_rmap(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)
like, twenty-two whole references. the rmap squad ate and left no crumbs π
and that's the whole page, bestie, no filler, no fluff π
β signed off from ./mm, dated October 2026, still section 9, still iconic β
π¦ 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