pud_alloc_one(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” the mm_struct of 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 NULL on error πŸ’€ (yes, you have to check it. always check it.)

⭐ SEE ALSO ⭐

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