sbitmap_init_node(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– sbitmap_init_node(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual ✨ β€” this one's all about sbitmap_init_node(9), and it's literally the glow-up moment where your &struct sbitmap gets born on the exact memory node of your choosing. no cap. πŸŽ€


🌸 NAME 🌸

sbitmap_init_node β€” Initialize a &struct sbitmap on a specific memory node. that's it, that's the whole vibe check πŸ’…


✨ SYNOPSIS ✨

int sbitmap_init_node (struct sbitmap *sb , unsigned int depth , int shift , gfp_t flags , int node , bool round_robin , bool alloc_hint );

like, look at all those arguments. she's got range. πŸ”₯


πŸ¦‹ ARGUMENTS πŸ¦‹

  • sb β€” the bitmap you're initializing. your main character. the one getting all the attention today πŸ‘‘
  • depth β€” how many bits to allocate. literally just the bit count, bestie. count 'em πŸ“
  • shift β€” use 2^shift bits per word in the bitmap. and here's the cute part: if you hand it a negative number, it picks a good default for you. so generous 🫢
  • flags β€” allocation flags. yes, the gfp_t kind.
  • node β€” which memory node to allocate on. picking where you live is a whole mood 🏠
  • round_robin β€” if true, it gets stricter about allocation order: always allocate starting from the last allocated bit. but heads up β€” this is less efficient than the default behavior (false). so like, slay for order, kinda meh for speed. πŸ™ˆ
  • alloc_hint β€” if true, apply a percpu hint for where to start searching for a free bit. it's giving "let me remember where I left off" energy ✨

⭐ RETURN ⭐

Zero on success, or a negative errno on failure. that's the whole deal β€” zero = you ate πŸ’…, negative = something went sideways 😭


🌈 SEE ALSO 🌈

Kernel file ./include/linux/sbitmap.h, plus the whole friend group:

iykyk 😌


okay that's the page!! mwah πŸ’‹ this lil manual lives down in ./include/linux, dated October 2026 β€” go off, kernel docs, you iconic thing. πŸ§šπŸ’œ

πŸ“¦ where this page comes from