modify_prot_start_ptes(9)
β¨ 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
lazy_mmu_mode_enable(9)lazy_mmu_mode_disable(9)__task_lazy_mmu_mode_pause(9)lazy_mmu_mode_pause(9)__task_lazy_mmu_mode_resume(9)lazy_mmu_mode_resume(9)pte_batch_hint(9)set_ptes(9)clear_young_dirty_ptes(9)get_and_clear_full_ptes(9)get_and_clear_ptes(9)clear_full_ptes(9)clear_ptes(9)clear_nonpresent_ptes(9)ptep_try_set(9)flush_tlb_before_set(9)wrprotect_ptes(9)clear_flush_young_ptes(9)test_and_clear_young_ptes(9)modify_prot_commit_ptes(9)pfnmap_setup_cachemode(9)pfnmap_track(9)pfnmap_untrack(9)pfnmap_setup_cachemode_pfn(9)
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
- 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