sbitmap_get_shallow(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ sbitmap_get_shallow(9) ✨

okay bestie, we're in the Kernel API Manual and this one is lowkey specific but fr fr useful πŸŽ€

🌸 NAME 🌸

sbitmap_get_shallow β€” try to allocate a free bit from a &struct sbitmap, limiting the depth used from each word. πŸ’…

πŸ¦‹ SYNOPSIS πŸ¦‹

int sbitmap_get_shallow (struct sbitmap *sb , unsigned long
shallow_depth );

πŸŽ€ ARGUMENTS πŸŽ€

  • sb β€” the bitmap to allocate from, bestie. 🫢
  • shallow_depth β€” the maximum number of bits to allocate from the bitmap. ✨

πŸ’– DESCRIPTION πŸ’–

So this is a rather specific operation, and it's giving "multiple users, different allocation limits" energy πŸ‘‘. E.g., there can be a high-priority class that uses sbitmap_get and a low-priority class that uses sbitmap_get_shallow with a shallow_depth of (sb->depth >> 1). Then, the low-priority class can only allocate half of the total bits in the bitmap, preventing it from starving out the high-priority class. no cap, that's the whole point 🧚

⭐ RETURN ⭐

Non-negative allocated bit number if successful, -1 otherwise. periodt. πŸ’…

🌈 SEE ALSO 🌈

Kernel file ./lib/sbitmap.c πŸ‘€


xoxo, sending you off with the ./lib source/version vibe, October 2026, and all the sbitmap_get_shallow(9) energy πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from