lookup_memtype(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– lookup_memtype(9) πŸ’–

okay so welcome to the Kernel API Manual entry for lookup_memtype(9), bestie β€” this one is short, iconic, and literally about looking up the memory type for a physical address. πŸŽ€

🌸 NAME 🌸

lookup_memtype β€” looks up the memory type for a physical address. periodt, that’s the whole name vibe. πŸ’…

✨ SYNOPSIS ✨

enum page_cache_mode lookup_memtype (u64 paddr );

🫢 ARGUMENTS 🫢

  • paddr β€” the physical address whose memory type needs to be looked up. That’s it, that’s the assignment, bestie. πŸ¦‹

πŸ’œ DESCRIPTION πŸ’œ

⚠️ Only to be called when PAT is enabled.

Like, only. This is not a β€œcall it whenever” situation, okay? 🚨

On the return side, it gives you one of these four constants:

  • _PAGE_CACHE_MODE_WB
  • _PAGE_CACHE_MODE_WC
  • _PAGE_CACHE_MODE_UC_MINUS
  • _PAGE_CACHE_MODE_WT

That’s the return squad, no cap. 🌈

🌈 SEE ALSO 🌈

Go check out the kernel file ./arch/x86/mm/pat/memtype.c and these besties too:


Cute sign-off: this page’s source/version is ./arch/x86/mm/pat, dated October 2026. Bye bestie, go look up those memory types responsibly πŸ’–βœ¨

πŸ“¦ where this page comes from