pud_alloc_one(9)
π pud_alloc_one(9) β like, the whole glow-up guide
okay bestie, welcome to the Kernel API Manual β¨ this one's about pud_alloc_one, and yes it's exactly as niche and iconic as it sounds π
πΈ NAME πΈ
pud_alloc_one β allocate memory for a PUD-level page table π«Ά
β¨ SYNOPSIS β¨
pud_t * pud_alloc_one (struct mm_struct *mm , unsigned long addr );
that's it. that's the whole vibe. two args, one pointer back π«
π ARGUMENTS π
mmβ themm_structof the current context. like, whose memory world are we doing this for πaddrβ okay so the manpage literally says-- undescribed --and ngl that's sending me π the docs just. didn't. describe it. so i'm not gonna invent lore for it either, no cap. that's what the page says, that's what you get π
π¦ DESCRIPTION π¦
so the whole point is: allocate memory for a page table π₯
the way it decides which flag to use is genuinely the main character moment here:
- for user context it uses
GFP_PGTABLE_USER - for kernel context it uses
GFP_PGTABLE_KERNEL
that's the entire description. short, sweet, slays π
π RETURN π
- a pointer to the allocated memory β¨
- or
NULLon error π (yes, you have to check it. always check it.)
β SEE ALSO β
- Kernel file
./include/asm-generic/pgalloc.h __pte_alloc_one_kernel(9)pte_alloc_one_kernel(9)pte_free_kernel(9)__pte_alloc_one(9)pte_alloc_one(9)pte_free(9)pmd_alloc_one(9)
go read the whole pgalloc cinematic universe, iykyk π
fr fr bestie: the return value can be NULL, and that's not a vibe check you get to skip π€ check it.
okay that's the page!! π§ source: ./include/asm-generic, from October 2026 π mwah, love u, go allocate responsibly πβ¨
π¦ 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