iommu_alloc_pages_node_sz(9)
π iommu_alloc_pages_node_sz(9) π
okay bestie, welcome to the Kernel API Manual, you're gonna love this one β¨
πΈ NAME πΈ
iommu_alloc_pages_node_sz β grab yourself a zeroed page of whatever size you want, from a specific NUMA node π― no cap.
β¨ SYNOPSIS β¨
void * iommu_alloc_pages_node_sz (int nid , gfp_t gfp , size_t size );
literally that's the whole vibe check right there π
π ARGUMENTS π
nidβ the memory NUMA node id, aka which node you're shopping at ποΈgfpβ the buddy allocator flags, the little knobs that say how you want it allocatedsizeβ the memory size you wanna allocate, and yes it gets rounded up to a power of 2 (more on that below, iykyk)
π¦ DESCRIPTION π¦
So what you get back? The virtual address of the allocated page π that's your prize.
now the important part, bestie, do NOT just leave it lying around:
The page must be freed, either by callingiommu_free_pagesor viaiommu_put_pages_listπ«Ά fr fr, free your pages.
and here's the cute little detail about what you actually got: the returned allocation is round_up_pow_two(size) big π₯ and it's physically aligned to its size. iconic behavior honestly π
π SEE ALSO π
peep the kernel file ./drivers/iommu/iommu-pages.c and then go read these besties:
iommu_free_pages(9)iommu_put_pages_list(9)iommu_pages_start_incoherent(9)iommu_pages_start_incoherent_list(9)iommu_pages_stop_incoherent_list(9)iommu_pages_free_incoherent(9)
and that's the whole page, periodt π
β¨ this cutie lives in ./drivers/iommu, dated October 2026, and it goes by iommu_alloc_pages_node_sz(9) β mwah, go allocate responsibly π§π
π¦ 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