sbitmap_init_node(9)
π 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β use2^shiftbits 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, thegfp_tkind.nodeβ which memory node to allocate on. picking where you live is a whole mood πround_robinβ iftrue, 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β iftrue, 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:
struct sbitmap_word(9)struct sbitmap(9)struct sbq_wait_state(9)struct sbitmap_queue(9)sbitmap_free(9)sbitmap_resize(9)sbitmap_get(9)sbitmap_any_bit_set(9)__sbitmap_for_each_set(9)sbitmap_for_each_set(9)sbitmap_show(9)sbitmap_weight(9)sbitmap_bitmap_show(9)sbitmap_queue_init_node(9)sbitmap_queue_free(9)sbitmap_queue_recalculate_wake_batch(9)sbitmap_queue_resize(9)__sbitmap_queue_get(9)__sbitmap_queue_get_batch(9)sbitmap_queue_get_shallow(9)sbitmap_queue_get(9)sbitmap_queue_min_shallow_depth(9)sbitmap_queue_clear(9)sbitmap_queue_clear_batch(9)sbq_wait_ptr(9)sbitmap_queue_wake_all(9)sbitmap_queue_wake_up(9)sbitmap_queue_show(9)
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
- 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