pfnmap_track(9)
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β thepgprotto 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
- 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