clear_flush_young_ptes(9)
π clear_flush_young_ptes(9) β Kernel API Manual, bestie edition π
okay so like, welcome to the clear_flush_young_ptes(9) page from the Kernel API Manual β¨ β yes that whole title, we're keeping it, it's giving official. Sit down, grab a strawberry π, and let's get into it.
πΈ NAME πΈ
clear_flush_young_ptes β marks PTEs that map consecutive pages of the same folio as old, and flushes the TLB. literally that's the whole job. icon behavior tbh π
β¨ SYNOPSIS β¨
bool clear_flush_young_ptes (struct vm_area_struct *vma , unsigned long
addr , pte_t *ptep , unsigned int nr );
no cap, that's the signature, copy it exactly, don't be weird about the spacing π
π¦ ARGUMENTS π¦
vmaβ the virtual memory area the pages are mapped into. like, the neighborhood the pages live in π‘addrβ the address the first page is mapped at. first one only, bestie, the rest follow along π«Άptepβ page table pointer for the first entry. your starting point πnrβ number of entries to clear the access bit on. count 'em π’
π§ DESCRIPTION π§
So this one may be overridden by the architecture π β meaning some arches go off and do their own thing with it. Otherwise? It's implemented as a simple loop over ptep_clear_flush_young. simple loop, simple life, we love a low-effort icon β¨
β οΈ heads up though: PTE bits in the PTE range besides the PFN can differ. for example, some PTEs might be write-protected. it's giving "same folio, different vibes" π so don't assume they're identical just because they're neighbors.
π₯ CONTEXT π₯
the deets on when you can even call this:
- The caller holds the page table lock π no lock, no entry, periodt.
- The PTEs map consecutive pages that belong to the same folio π
- The PTEs are all in the same PMD π
that's the vibe check, pass it before you call π
π SEE ALSO π
Kernel file ./include/linux/pgtable.h β and honestly the whole friend group shows up here, so:
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), 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)
like a whole crew, iykyk π
okay and for the cute sign-off π«Ά this page lives in ./include/linux, it's dated October 2026, and it's filed under clear_flush_young_ptes(9) β mwah, go flush something, bestie ππ
π¦ 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