folio_add_file_rmap_pmd(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ folio_add_file_rmap_pmd ✨

okay so bestie, this is a page from the Kernel API Manual and honestly? it's giving "niche but iconic" πŸ’… this little function lives in folio_add_file_rmap_pmd(9) land and its whole job is literally adding a PMD mapping to a page range of a folio. no cap. let's get into it 🫢


🌸 NAME 🌸

folio_add_file_rmap_pmd β€” add a PMD mapping to a page range of a folio ✨


πŸŽ€ SYNOPSIS πŸŽ€

void folio_add_file_rmap_pmd (struct folio *folio , struct page *page ,
struct vm_area_struct *vma );

that's the whole vibe right there πŸ‘‘ three pointers, one function, zero drama (as long as you read the DESCRIPTION section, which you will, because I said so πŸ’€).


πŸ¦‹ ARGUMENTS πŸ¦‹

  • folio β€” the folio you're adding the mapping to πŸ“ like, the main character of this whole operation.
  • page β€” the first page to add. yes, first. there are more. keep reading. πŸ™ˆ
  • vma β€” the vm area in which the mapping gets added 🌈 that's the neighborhood the mapping is moving into.

πŸ’– DESCRIPTION πŸ’–

so the page range of the folio is defined by [page, page + HPAGE_PMD_NR) β€” that's the exact spec, don't come for me, I'm just the messenger ✨ and yeah, HPAGE_PMD_NR is doing a lot of heavy lifting there, bestie. it ate. πŸ’…

🚨 okay important thing, listen up: the caller needs to hold the page table lock. this is not optional, this is not a suggestion, this is the vibe check you must pass before calling this function. fr fr. πŸ”₯

⭐ SEE ALSO ⭐

all the neighbors in the Kernel file ./mm/rmap.c β€” a whole group chat of functions, and yes they all get named, I'm not skipping a single one because that would be rude 😭:

like, that's the whole squad right there, iykyk 🌸


and that's the page, diva πŸ’œ sourced straight from ./mm with a date stamp of October 2026 β€” love that for us, a little time traveler moment 🧚 stay locked, stay mapped, and remember the page table lock, mwah πŸŽ€πŸ«Ά

πŸ“¦ where this page comes from