clear_flush_young_ptes(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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