wp_pte(9)
π wp_pte(9) β the write-protect glow-up bestie edition β¨
okay so real talk, this is a page from the Kernel API Manual and it's about wp_pte, which is genuinely one of those tiny functions that carries the whole squad. come learn her with me π«Ά
β¨ NAME β¨
wp_pte β write-protect a pte π
like, that's the whole vibe. she protects. she writes-not. she's iconic.
πΈ SYNOPSIS πΈ
int wp_pte (pte_t *pte , unsigned long addr , unsigned long end , struct
mm_walk *walk );
yes the spacing is a little feral, that's canon, do not touch it π
π ARGUMENTS π
pteβ Pointer to the pte. that's the actual page table entry getting the write-protect treatment πaddrβ The start of protecting virtual address. lowkey where the range begins β¨endβ The end of protecting virtual address. and this is where the range stops, no cap π¦walkβ pagetable walk callback argument. she rides along for the walk, main character energy for sure π
π DESCRIPTION π
so what does she actually do? The function write-protects a pte and records the range in virtual address space of touched ptes for efficient range TLB flushes. π₯
like yes, two jobs, and she ate both. the write-protect is the obvious part, but the recording part is the sneaky-genius part β she's keeping receipts of which virtual address ranges got touched so that later the range TLB flushes can be done efficiently instead of one-at-a-time like a loser. so efficient. so considerate. obsessed honestly π
π§ SEE ALSO π§
- Kernel file
./mm/mapping_dirty_helpers.cβ that's her home address, go visit π‘ struct wp_walk(9)struct clean_walk(9)clean_record_pte(9)wp_shared_mapping_range(9)clean_record_shared_mapping_range(9)
the whole friend group fr fr, they all show up to the same functions π π«Ά
ngl bestie, wp_pte is called as part of a larger walk thing and she expects her args to make sense β go read the SEE ALSO squad before you go poking at ptEs in your own code, iykyk πβ¨
okay that's the whole page, no cap π this came from the ./mm source directory, October 2026 vintage, and it's filed under wp_pte(9) β go forth and write-protect responsibly my love πππ¦
π¦ 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