mm_account_fault(9)
π mm_account_fault(9) β like, the page fault accounting girlies π
okay so this is a page from the Kernel API Manual, bestie β it's mm_account_fault(9) and it's genuinely the moment where the kernel sits down and does its page fault bookkeeping. pull up a chair π
β¨ NAME β¨
mm_account_fault β do page fault accounting π (yes that's the whole vibe, it literally just tallies up faults)
π¦ SYNOPSIS π¦
void mm_account_fault (struct mm_struct *mm , struct pt_regs *regs ,
unsigned long address , unsigned int flags , vm_fault_t ret );
it returns void, so no return value drama β it just does the thing and dips βοΈ
πΈ ARGUMENTS πΈ
mmβ themmwe're pulling the memcg out of. it can beNULL, no cap, that's allowed π«Άregsβ thept_regsstruct pointer. when it's set toNULLwe skip the accounting of perf event counters β but we still do the per-task accounting to the task that triggered this page fault. so like, don't think you're getting out of it entirely πaddressβ the faulted address. the address that faulted. the one and only πflagsβ the fault flags π©retβ the fault retcode β
π DESCRIPTION π
okay so the way that this is doing the most β it takes care of most of the page fault accounting. iconic. and it also includes the PERF_COUNT_SW_PAGE_FAULTS_[MAJ|MIN] perf counter updates π₯
but listen, bestie β the handling of PERF_COUNT_SW_PAGE_FAULTS should still be in per-arch page fault handlers at the entry of page fault. that one's not on this function, mmkay? don't come for her π
π§ SEE ALSO π§
Kernel file ./mm/memory.c β and like, the whole extended friend group:
free_pgd_range(9),free_pgtables(9),__vm_normal_page(9),vm_normal_page(9),vm_normal_folio(9)vm_normal_page_pmd(9),vm_normal_folio_pmd(9),vm_normal_page_pud(9)restore_exclusive_pte(9),cond_install_uffd_wp_ptes(9)zap_vma_for_reaping(9),unmap_vmas(9),zap_vma_range_batched(9),zap_vma_range(9),zap_special_vma_range(9)vm_insert_pages(9),vm_insert_page(9),vm_map_pages(9),vm_map_pages_zero(9)vmf_insert_pfn_prot(9),vmf_insert_pfn(9),remap_pfn_range(9),vm_iomap_memory(9)__vmf_anon_prepare(9),finish_mkwrite_fault(9)unmap_mapping_folio(9),unmap_mapping_pages(9),unmap_mapping_range(9)set_pte_range(9),finish_fault(9)follow_pfnmap_start(9),follow_pfnmap_end(9)generic_access_phys(9),access_remote_vm(9),copy_remote_vm_str(9),folio_zero_user(9)
and that's the whole page, bestie β go account some faults responsibly π
this cutie came out of ./mm and it's dated October 2026, iykyk πβ¨
π¦ 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