limit_nareas(9)
π limit_nareas(9) β the kernel API manual, but make it make sense
okay so bestie, this one is limit_nareas from the kernel API manual and it's genuinely so simple you're gonna be like "wait that's it?" β yes babes, that's it β¨
π NAME π
limit_nareas β get the maximum number of areas for a given memory pool size
like, you hand it a pool size and it tells you how many areas you can possibly have. that's the whole vibe check π
β¨ SYNOPSIS β¨
unsigned int limit_nareas (unsigned int nareas , unsigned long nslots );
two args, one unsigned int coming back at you. no cap, that's the entire function signature π«Ά
πΈ ARGUMENTS πΈ
nareasβ the desired number of areas. like, what you want. dream big bestie πnslotsβ the total number of slots in the memory pool. this is the reality check π
π¦ DESCRIPTION π¦
so what it does is: it limits the number of areas to the maximum possible number of areas in a memory pool of the given size.
read that again. slower. π
you come in with your desired nareas, and this function clamps it down to whatever the pool can actually hold, given nslots total slots. it's giving "the universe said no" but make it C. lowkey iconic behaviour honestly π
π RETURN π
returns the maximum possible number of areas. that's it. that's the return value. no error codes, no tricks, just a number. periodt π
π₯ SEE ALSO π₯
bestie there are SO many friends in this list, grab a snack π
- Kernel file
./kernel/dma/swiotlb.c struct io_tlb_slot(9)struct io_tlb_area(9)swiotlb_adjust_nareas(9)add_mem_pool(9)alloc_dma_pages(9)swiotlb_alloc_tlb(9)swiotlb_free_tlb(9)swiotlb_alloc_pool(9)swiotlb_dyn_alloc(9)__swiotlb_find_pool(9)swiotlb_del_pool(9)swiotlb_dev_init(9)swiotlb_align_offset(9)swiotlb_search_pool_area(9)swiotlb_search_area(9)swiotlb_find_slots(9)mem_pool_used(9)mem_used(9)swiotlb_tbl_map_single(9)swiotlb_del_transient(9)is_swiotlb_allocated(9)default_swiotlb_base(9)default_swiotlb_limit(9)
the way that swiotlb shows up in, like, almost every single one π it's a whole family fr fr
ngl the wholeswiotlbcrew lives in./kernel/dmaand they're all deeply interconnected. go read them, iykyk π
that's the page!! mwah π this little cutie lives in ./kernel/dma and the version we're serving you is dated October 2026 β go off, kernel girlies π§ββοΈπΈ
π¦ 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