folio_remove_rmap_pmd(9)
π folio_remove_rmap_pmd β like, the whole kernel API manual vibe β¨
okay so bestie, welcome to the Kernel API Manual π β yes, that's the manual name, we're doing this properly β and today's main character is folio_remove_rmap_pmd(9). Buckle up π¦
β¨ NAME β¨
folio_remove_rmap_pmd β removes a PMD mapping from a page range of a folio π
no cap, that's literally the whole job
πΈ SYNOPSIS πΈ
void folio_remove_rmap_pmd (struct folio *folio , struct page *page ,
struct vm_area_struct *vma );
that's it, that's the signature, copy it exactly bestie π«Ά
π ARGUMENTS π
folioβ the folio we're removing the mapping from, like, the star of the show πpageβ the first page to remove. first one. the beginning. the main character of the range πvmaβ the vm area from which the mapping is removed, iykyk π¦
β DESCRIPTION β
okay so the page range of the folio is defined by [page, page + HPAGE_PMD_NR) β that's the range, that's the math, don't come for me π₯
π¨ real talk: the caller needs to hold the page table lock. like, actually. not optionally. hold the lock, bestie, or it's giving undefined behaviour energy π
π SEE ALSO π
because we're thorough and we link everything fr fr β all from the kernel file ./mm/rmap.c:
__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_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_pud(9)try_to_unmap(9)try_to_migrate(9)make_device_exclusive(9)__rmap_walk_file(9)
and that's the page!! π§ββοΈ she lives in ./mm, she's dated October 2026, and she's filed under folio_remove_rmap_pmd(9) β mwah, slay, periodt ππ
π¦ 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