check_pte(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” a page_vma_mapped_walk struct, and it's carrying a cute little pair for you: a pte and a pfn range, and that range is what we're checking, no cap 🫢
  • pte_nr β€” the number of small pages described by pvmw->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 🧚

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