clear_young_dirty_ptes(9)
β¨ 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 β
- 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)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_start_ptes(9)modify_prot_commit_ptes(9)pfnmap_setup_cachemode(9)pfnmap_track(9)pfnmap_untrack(9)pfnmap_setup_cachemode_pfn(9)
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
- 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