pud_set_huge(9)
π 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 calledaddrand yes it's a virtual address, that's just how it is, iykykprotβ 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 π
- Kernel file
./arch/x86/mm/pgtable.c reserve_top_address(9)p4d_set_huge(9)p4d_clear_huge(9)pmd_set_huge(9)pud_clear_huge(9)pmd_clear_huge(9)pmd_free_pte_page(9)
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
- 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