thp_vma_allowable_orders(9)
π thp_vma_allowable_orders β the kernel API manual, bestie edition β¨
okay so real talk, this is a page from the Kernel API Manual and it's literally about figuring out which hugepage orders a vma is allowed to use. let's get into it π«Ά
πΈ NAME πΈ
thp_vma_allowable_orders β determine hugepage orders that are allowed for vma
like, which hugepage orders can this vma actually have? that's the whole vibe check. π
β¨ SYNOPSIS β¨
unsigned long thp_vma_allowable_orders (struct vm_area_struct *vma ,
vm_flags_t vm_flags , enum tva_type type , unsigned long orders );
that's the signature, copy it exactly bestie, no typos, we don't do that here π
π ARGUMENTS π
vmaβ the vm area to check. this is the main character of the whole function ngl πvm_flagsβ use these vm_flags instead ofvma->vm_flags. yes, it overrides the vma's own flags, that's the point π¦typeβ the TVA type. that's it, that's the description, it's giving mysterious πordersβ bitfield of all orders to consider. everything you want in the running π
π DESCRIPTION π
so what does it actually do? it calculates the intersection of the requested hugepage orders and the allowed hugepage orders for the provided vma. intersection. set math. she's a mathematician π β¨
permitted orders are encoded as a set bit at the corresponding bit position β so:
- bit-2 corresponds to order-2
- bit-3 corresponds to order-3
- etc, you get the pattern iykyk
β οΈ heads up: Order-0 is never considered a hugepage order. periodt. don't come for her about order-0, she said no π
π₯ RETURN π₯
bitfield of orders allowed for hugepage in the vma. π
and if nothing's allowed? she returns 0 β 0 if no hugepage orders are allowed. no orders, no vibes, empty bitfield, we die π
π SEE ALSO π
kernel file ./include/linux/huge_mm.h, plus the whole friend group:
go read those too, they're iconic in their own right π§π
okay that's the whole page bestie, you ate, go read some kernel headers π
source and version: ./include/linux β dated October 2026. mwah, love u, bye π«Άβ¨
π¦ 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