folio_add_anon_rmap_pmd(9)
π folio_add_anon_rmap_pmd π
okay bestie, so this is a page straight outta the Kernel API Manual and it's genuinely kinda iconic β it's about adding a PMD mapping to a page range of an anon folio. yes, that's a real sentence, and yes, we're gonna get through it together π«Ά
β¨ NAME β¨
folio_add_anon_rmap_pmd β add a PMD mapping to a page range of an anon folio π
π SYNOPSIS π
void folio_add_anon_rmap_pmd (struct folio *folio , struct page *page ,
struct vm_area_struct *vma , unsigned long address , rmap_t flags );
like, look at her go. five arguments, zero notes π
πΈ ARGUMENTS πΈ
folioβ the folio we're adding the mapping to, the main character ofc πpageβ the first page to add. the opener, the headliner, page #1 β¨vmaβ the vm area in which the mapping is added π¦addressβ the user virtual address of the first page to map π―flagsβ the rmap flags. that's it, that's the whole description, ngl π
π§ DESCRIPTION π§
so the page range of folio is defined by [first_page, first_page + HPAGE_PMD_NR) β that bracket is closed on the left and open on the right, she's precise like that π
β οΈ real talk, bestie: the caller needs to hold the page table lock, and the page must be locked in theanon_vmacase β that's to serializemapping,indexchecking after setting. don't skip this, fr fr π
π SEE ALSO π
kernel file ./mm/rmap.c plus the whole friend group:
__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)__folio_set_anon(9)__page_check_anon_rmap(9)folio_add_anon_rmap_ptes(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)
and that's the whole page, bestie, no cap π this lil gem lives over in ./mm and it's dated October 2026, filed under the Kernel API Manual β go off, folio_add_anon_rmap_pmd(9), you ate πβ¨
π¦ 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