vm_normal_page_pmd(9)
π vm_normal_page_pmd(9) β like, the "get the struct page for a PMD" girlie β¨
okay so this is a page from the Kernel API Manual, bestie β section 9, kernel dev vibes only. pull up a chair π
πΈ NAME πΈ
vm_normal_page_pmd β literally just gets you the "struct page" that's associated with a PMD. that's the whole gig. iconic behavior, no notes π
β¨ SYNOPSIS β¨
struct page * vm_normal_page_pmd (struct vm_area_struct *vma , unsigned
long addr , pmd_t pmd );
so she takes three things and gives you back a struct page *, periodt π«Ά
π¦ ARGUMENTS π¦
vmaβ the VMA that's mapping the pmd. like, the neighborhood the pmd lives in π‘addrβ the address where the pmd is mapped. the exact spot, no cap πpmdβ the PMD. yeah. it's the PMD. that's it. that's the argument π
π DESCRIPTION π
okay so β get the "struct page" associated with a PTE. yes, we know the function name says PMD and this sentence says PTE, we're just relaying the lore, don't come for us π
if you want the details on what counts as a "normal" mapping versus a "special" mapping, go read __vm_normal_page β she's the main character who explains all of that. this one's just the PMD-flavored sibling π
π RETURN π
- returns the
"struct page"if this is a"normal"mapping β slay - returns
NULLif this is a"special"mapping π« so if you getNULL, don't panic, that's just the vibe check result
π SEE ALSO π
all the sister functions and neighbors, fr fr β the whole group chat lives in the kernel file ./mm/memory.c:
free_pgd_range(9)free_pgtables(9)__vm_normal_page(9)vm_normal_page(9)vm_normal_folio(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)mm_account_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)
π friendly reminder:NULLback does not mean something broke β it means"special"mapping. read the room before you file a bug, bestie.
and that's the page!! shipped from ./mm, dated October 2026 πΈ stay hydrated, keep your struct page * checks honest, and remember: normal mappings get a page, special mappings get NULL, and you get to slay πβ¨
π¦ 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