vma_alloc_folio(9)
β¨ NAME β¨
okay so this is vma_alloc_folio(9), straight from the Kernel API Manual, bestie β and it's literally about allocating a folio for a VMA. iconic behavior, no cap π
π¦ SYNOPSIS π¦
struct folio * vma_alloc_folio (gfp_t gfp , int order , struct
vm_area_struct *vma , unsigned long addr );
πΈ ARGUMENTS πΈ
gfpβ the GFP flags, fr fr. they matter.orderβ the order of the folio. yes bestie, order.vmaβ a pointer to the VMA. main character pointer energy.addrβ the virtual address of the allocation. it must be insidevmaβ like, non-negotiable, okay? π
π DESCRIPTION π
So what this does is allocate a folio for a specific address in vma, using the appropriate NUMA policy. slay.
π but listen: the caller must hold themmap_lockof themm_structof the VMA to prevent it from going away. that's not a vibe check you can skip, bestie β it's required.
You should use this for all allocations for folios that will be mapped into user space, excepting hugetlbfs, and excepting where direct use of folio_alloc_mpol is more appropriate. iykyk β¨
π RETURN π
The folio on success π«Ά or NULL if allocation fails π. that's the whole return section, periodt.
π SEE ALSO π
- Kernel file
./mm/mempolicy.c numa_nearest_node(9)nearest_node_nodemask(9)folio_can_map_prot_numa(9)alloc_pages_mpol(9)alloc_pages(9)mpol_misplaced(9)mpol_shared_policy_init(9)mpol_parse_str(9)mpol_to_str(9)
kisses bestie π this whole little page comes from source ./mm, dated October 2026, and the title is vma_alloc_folio(9) β and that's the cute sign-off, 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