vma_alloc_folio(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 inside vma β€” 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 the mmap_lock of the mm_struct of 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 🌈


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