clear_young_dirty_ptes(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ clear_young_dirty_ptes(9) ✨

okay so this is a page from the Kernel API Manual, section 9 β€” the kernel-internals girlies know πŸ’…


πŸŽ€ NAME πŸŽ€

clear_young_dirty_ptes β€” marks PTEs that map consecutive pages of the same folio as old/clean. that's it, that's the whole job 🫢


🌸 SYNOPSIS 🌸

void clear_young_dirty_ptes (struct vm_area_struct *vma , unsigned long
addr , pte_t *ptep , unsigned int nr , cydp_t flags );

πŸ’– ARGUMENTS πŸ’–

  • vma β€” literally marked -- undescribed -- in the docs 😭 the manpage said "no thoughts, head empty" on this one, so we're not gonna invent anything. ngl it's giving mystery.
  • addr β€” the address where the first page is mapped at. your starting point, bestie πŸ“
  • ptep β€” page table pointer for the first entry. the entry point, if you will ✨
  • nr β€” how many entries you're marking old/clean. a whole little squad of them πŸ”₯
  • flags β€” flags to modify the PTE batch semantics. yes they change how the batch behaves, and yes that matters 🌈

πŸ¦‹ DESCRIPTION πŸ¦‹

so this function may be overridden by the architecture β€” arch girlies get to do their own thing πŸ’… β€” otherwise it's implemented by get_and_clear/modify/set for each pte in the range. one by one, no skipping πŸŽ€

heads up: PTE bits in the PTE range besides the PFN can differ! for example, some PTEs might be write-protected. so don't go assuming every entry in the batch is a perfect twin, because it is not πŸ™ˆ

πŸ‘‘ CONTEXT πŸ‘‘

the caller holds the page table lock πŸ”’ periodt.

the PTEs map consecutive pages that belong to the same folio. and all the PTEs are in the same PMD. same folio, same PMD, no cap 🧚


⭐ SEE ALSO ⭐


and that's the whole page, bestie πŸ“ this one lives in ./include/linux, stamped October 2026, and it's filed under clear_young_dirty_ptes(9) β€” go forth and clear those young dirty PTEs, love u πŸ’œπŸ¦‹

πŸ“¦ where this page comes from