modify_prot_start_ptes(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

Okay bestie, this is modify_prot_start_ptes(9) from the Kernel API Manual, and it's giving β€œstart a pte protection read-modify-write transaction over a batch of ptes” πŸ’…. The whole point is that it protects against asynchronous hardware modifications to the ptes. Important nuance, no cap: the intention is not to prevent the hardware from making pte updates, but to prevent any updates it may make from being lost. For the full description, please see the comment above ptep_modify_prot_start(). iykyk 🫢

🌸 SYNOPSIS 🌸

pte_t modify_prot_start_ptes (struct vm_area_struct *vma , unsigned long addr , pte_t *ptep , unsigned int nr );

πŸŽ€ ARGUMENTS πŸŽ€

  • vma β€” the virtual memory area the pages are mapped into. She's the neighborhood, basically 🏑.
  • addr β€” the address the first page is mapped at. Where the first page parks its car ✨.
  • ptep β€” page table pointer for the first entry. Your little pointer bestie πŸ‘‰.
  • nr β€” number of entries. Yes, that many πŸ‘‘.

πŸ’œ DESCRIPTION πŸ’œ

Okay so this one may be overridden by the architecture; otherwise, it's implemented as a simple loop over ptep_modify_prot_start, collecting the a/d bits from each pte in the batch. Cute, right? πŸ’–

Note that PTE bits in the PTE batch besides the PFN can differ. Fr fr, they're not all required to be identical β€” that's the whole note.

πŸ”₯ CONTEXT πŸ”₯

Context check, bestie: the caller holds the page table lock. The PTEs map consecutive pages that belong to the same folio. All other PTE bits must be identical for all PTEs in the batch except for young and dirty bits. And the PTEs are all in the same PMD. Slay, but follow the rules πŸ’….

🌈 SEE ALSO 🌈

Kernel file: ./include/linux/pgtable.h


Okay that's the page, bestie πŸ’–. Cute sign-off moment: this one comes from ./include/linux, dated October 2026, and it's the modify_prot_start_ptes(9) page signing off. Mwah πŸŽ€βœ¨

πŸ“¦ where this page comes from