hugetlb_alloc_folio(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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