pud_set_huge(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… pud_set_huge β€” the "go big or go home" PUD mapping moment

okay so bestie, welcome to the kernel API manual, this one's from pud_set_huge(9) and it's genuinely about making one absolutely massive page table entry happen. let's get into it πŸŽ€


✨ NAME ✨

pud_set_huge β€” set up a kernel PUD mapping. that's it, that's the whole vibe. one entry, one huge page, no cap πŸ”₯


🌸 SYNOPSIS 🌸

int pud_set_huge (pud_t *pud , phys_addr_t addr , pgprot_t prot );

literally the whole function signature right there, character for character, don't @ me πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • pud β€” pointer to the PUD entry. this is the main character, the thing we're setting up πŸ‘‘
  • addr β€” the virtual address that goes with that PUD entry. yes it's called addr and yes it's a virtual address, that's just how it is, iykyk
  • prot β€” the protection bits we're gonna use. protection is important bestie 🫢

πŸ’– DESCRIPTION πŸ’–

okay so here's the tea β˜• β€” MTRRs can override PAT memory types with 4KiB granularity. like, 4KiB at a time. so because of that, this function only sets up a huge page if the complete range has the same MTRR caching mode. the way that it just checks the whole range first before committing? obsessed. it's giving "read the room before you speak" energy ✨

and hey, if you're a caller and the bigger page mapping attempt fails? don't spiral. the manual says callers should try to decrease page size β€” 1GB -> 2MB -> 4K β€” like a graceful little downgrade ladder, one rung at a time. very demure, very mindful 🌈

returns 1 on success and 0 on failure. that's the whole return story, no surprises, no drama πŸŽ€


🌟 SEE ALSO 🌟

go read those too, bestie, they're the whole friend group πŸ’œ


and that's the page!! this iconic little number lives in ./arch/x86/mm and the manual itself is dated October 2026 β€” yes, future girl summer πŸ¦‹β­ tysm for reading, mwah πŸ’‹πŸ’–

πŸ“¦ where this page comes from