pfn_mkclean_range(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… pfn_mkclean_range(9) β€” the Kernel API Manual, bestie edition πŸŽ€

okay so real talk, this one lives in the Kernel API Manual and she's a little technical queen, but we're gonna get through it together, i promise 🫢


✨ NAME ✨

pfn_mkclean_range β€” she cleans the PTEs (and yes, the PMDs too, don't forget the PMDs πŸ’€) that are mapped across the range of [@pfn, @pfn + @nr_pages) at the specific offset (@pgoff) inside the @vma of shared mappings. and because clean PTEs have to be readonly too (it's giving "obviously"), she write-protects them as well. two jobs, one function, main character energy πŸ‘‘


🌸 SYNOPSIS 🌸

int pfn_mkclean_range (unsigned long pfn , unsigned long nr_pages ,
       pgoff_t pgoff , struct vm_area_struct *vma );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • pfn β€” the start pfn. that's the beginning, the origin story, where it all kicks off ✨
  • nr_pages β€” how many physically contiguous pages we're dealing with, starting with pfn. like a little squad of pages, all lined up 🫢
  • pgoff β€” the page offset that the pfn is mapped with. the exact spot, iykyk πŸ“
  • vma β€” the vma that pfn is mapped within. her home, her turf, her whole vibe 🏑

πŸ’– DESCRIPTION πŸ’–

returns the number of cleaned PTEs (including PMDs). that's it, that's the whole deal β€” she does the work, she reports back how many she did, no cap πŸ”₯


🌈 SEE ALSO 🌈

the kernel file ./mm/rmap.c and honestly her entire friend group, because these functions literally all hang out together:

like, the whole rmap.c group chat. genuinely iconic of them πŸ’œ


heads up bestie: this page is sourced from ./mm and her version stamp says October 2026 β€” so she's fresh, she's current, she's that girl πŸ§šβ€β™€οΈβ­

anyway ily, go clean those PTEs, and remember: write protect = protect your energy πŸ’…πŸŽ€

πŸ“¦ where this page comes from