limit_nareas(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 πŸ“

the way that swiotlb shows up in, like, almost every single one 😭 it's a whole family fr fr


ngl the whole swiotlb crew lives in ./kernel/dma and 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