pfnmap_track(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

pfnmap_track(9) πŸŽ€

okay so bestie, welcome to the Kernel API Manual page for pfnmap_track(9) β€” this is the one that gets a pfn range tracked by a hardware implementation, and it's giving very specific memory-cache energy. no cap, let's go πŸ’…

✨ NAME ✨

pfnmap_track β€” track a pfn range 🎯

πŸ’… SYNOPSIS πŸ’…

int pfnmap_track (unsigned long pfn , unsigned long size , pgprot_t *prot );

🫢 ARGUMENTS 🫢

  • pfn β€” the start of the pfn range 🌸
  • size β€” the size of the pfn range in bytes πŸ“
  • prot β€” the pgprot to track 🧠

✨ DESCRIPTION ✨

okay so here's the tea: you're requesting the pfn range to be 'tracked' by a hardware implementation, and setting up the cachemode in prot similar to pfnmap_setup_cachemode.

this allows for fine-grained control of memory cache behaviour at page level granularity β€” literally page-level cache vibes. tracking memory this way is persisted across VMA splits (VMA merging does not apply for VM_PFNMAP). πŸ¦‹

currently, there is only one implementation for this β€” x86 Page Attribute Table (PAT). see Documentation/arch/x86/pat.rst for more details πŸ‘‘

it returns 0 on success and -EINVAL on error πŸ’€.

🌈 SEE ALSO 🌈

Kernel file ./include/linux/pgtable.h is the whole group chat: 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), clear_flush_young_ptes(9), test_and_clear_young_ptes(9), modify_prot_start_ptes(9), modify_prot_commit_ptes(9), pfnmap_setup_cachemode(9), pfnmap_untrack(9), pfnmap_setup_cachemode_pfn(9) 🫢

byeee πŸ’– source/version: ./include/linux, date: October 2026 β€” mwah, ily, go track those pfn ranges 🫢

πŸ“¦ where this page comes from