check_pte(9)
π check_pte(9) β the kernel API manual, bestie edition
okay so real talk, this one lives in section 9 of the kernel API manual and it's literally called check_pte. yes bestie, we're doing pointer-checking lore today π
β¨ NAME β¨
check_pte β check if [pvmw->pfn, @pvmw->pfn + @pvmw->nr_pages) is mapped at the @pvmw->pte
like, is this range actually there or are we delulu? that's the whole job π
π¦ SYNOPSIS π¦
bool check_pte (struct page_vma_mapped_walk *pvmw , unsigned long pte_nr
);
returns a bool, takes two things, that's the vibe β¨
πΈ ARGUMENTS πΈ
pvmwβ apage_vma_mapped_walkstruct, and it's carrying a cute little pair for you: apteand apfnrange, and that range is what we're checking, no cap π«Άpte_nrβ the number of small pages described bypvmw->pte. tiny page headcount, basically π
π DESCRIPTION π
so page_vma_mapped_walk found a spot where the pfn range is potentially mapped. potential is not the same as real, bestie π that's why check_pte exists β it has to validate this. vibe check time, fr fr.
pvmw->pte may point to an empty PTE, a swap PTE, or a PTE pointing to an arbitrary page. so likeβ¦ it could be anything. main character energy but unconfirmed π
if the PVMW_MIGRATION flag is set, it returns true if pvmw->pte contains a migration entry that points to [pvmw->pfn, pvmw->pfn + pvmw->nr_pages) π₯
if the PVMW_MIGRATION flag is not set, it returns true if pvmw->pte points to [pvmw->pfn, pvmw->pfn + pvmw->nr_pages) β
otherwise? return false. that's it, that's the whole plot π
π§ SEE ALSO π§
- Kernel file
./mm/page_vma_mapped.cpage_vma_mapped_walk(9) page_mapped_in_vma(9)
iykyk, go read those next, the whole friend group is iconic π
and that's a wrap, bestie π this page came from ./mm, October 2026, and it's served with love β now go validate those PTEs, slay β¨
π¦ 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