hugetlb_alloc_folio(9)
okay bestie, this is hugetlb_alloc_folio(9) from the Kernel API Manual π
and it's literally the page about allocating a hugetlb folio. stay with me, it's not scary, i promise π«Ά
β¨ NAME β¨
hugetlb_alloc_folio β allocate a hugetlb folio. periodt. π
πΈ SYNOPSIS πΈ
struct folio * hugetlb_alloc_folio (struct hstate *h , struct
mempolicy_interpreted *mpoli , u8 alloc_flags );
π ARGUMENTS π
hβ the hugetlb state control block. yes bestie, the state girlie.mpoliβ the interpreted memory policy to use for this allocation.alloc_flagsβ flags controlling the allocation behavior. tiny but important, lowkey.
π DESCRIPTION π
this one allocates a hugetlb folio and handles cgroup charging + global hstate reservations. it's giving "i got you, bestie" energy fr fr. β¨
π₯ RETURN π₯
you get a pointer to the allocated folio on the success path π or an ERR_PTR on failure π. the error specifics are:
-ENOSPCβ if cgroup charging fails, or if no folio is available. π-ENOMEMβ if mem cgroup charging fails. π
π SEE ALSO π
kernel file ./mm/hugetlb.c, plus these icon besties: huge_pmd_unshare(9), folio_isolate_hugetlb(9), and folio_putback_hugetlb(9). iykyk π¦
okay that's the page, bestie π«Ά the source/version is ./mm, the date is October 2026, and the page itself is hugetlb_alloc_folio(9). slay and goodbye π
β¨
π¦ 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