folio_add_file_rmap_ptes(9)
π folio_add_file_rmap_ptes(9) β like, the kernel API manual bestie π
okay so this is a page from the Kernel API Manual, and the star of the show is folio_add_file_rmap_ptes. she's a function, she adds PTE mappings to a page range of a folio, and honestly? she ate. let's get into it π«Ά
β¨ NAME β¨
folio_add_file_rmap_ptes β add PTE mappings to a page range of a folio
like literally that's the whole vibe. adding PTE mappings. to a page range. of a folio. no cap. π
πΈ SYNOPSIS πΈ
void folio_add_file_rmap_ptes (struct folio *folio , struct page *page ,
int nr_pages , struct vm_area_struct *vma );
yep, that's the whole signature, character for character, don't @ me π
π¦ ARGUMENTS π¦
folioβ the folio we're adding the mappings to. she's the main character here πpageβ the first page to add. like, the beginning of the whole situation β¨nr_pagesβ how many pages are gonna get mapped using PTEs. count 'em, bestie π₯vmaβ the vm area where the mappings get added. that's her home turf π
π DESCRIPTION π
so the page range of the folio is defined by [page, page + nr_pages). that's the little window of pages we're talking about β start at page, go up to but not including page + nr_pages. classic half-open interval behavior, we love to see it π§
β οΈ okay this part is important: the caller needs to hold the page table lock. like, you gotta hold it. no lock, no entry. this is not optional and it's not a suggestion, it's giving "prerequisite" energy π
β SEE ALSO β
okay buckle up bestie, the cross-reference list is LONG and honestly iconic. this is the kernel file ./mm/rmap.c crew πΈ:
__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_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)
fr fr that's the whole squad, all of them, literally every single one π
and that's the page!! π mwah π
this lil transmission came to you from ./mm, dated October 2026, and it's all about folio_add_file_rmap_ptes(9) β stay hydrated, hold your page table lock, and slay bestie π¦β¨
π¦ 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