__sbitmap_queue_get_batch(9)
πΈ __sbitmap_queue_get_batch(9) β Kernel API Manual, bestie edition πΈ
okay so picture this: you're deep in the kernel, you've got a bitmap queue, and you don't want one free bit, you want a whole lil squad of them. That's this function. It lives in the Kernel API Manual and it's genuinely so useful, iykyk π
β¨ NAME β¨
__sbitmap_queue_get_batch β try to allocate a batch of free bits π
like, try. It's giving "best effort", not "guaranteed", and honestly? respect.
π¦ SYNOPSIS π¦
unsigned long __sbitmap_queue_get_batch (struct sbitmap_queue *sbq , int
nr_tags , unsigned int *offset );
look at her. one function call, three params, returns an unsigned long. main character energy fr fr π
π ARGUMENTS π
sbqβ the bitmap queue you're allocating from. this is your source, your supply, your whole vibe. π«Άnr_tagsβ how many tags you're asking for. the number of tags requested, bestie, that's literally it.offsetβ an offset to add to the returned bits. it's a pointer, so she's writing back to you. pay attention. β¨
β RETURN β
A mask of allocated tags, or 0 if none are found. π (yes, 0 means you got nothing, sorry.)
Here's the part you cannot skip, no cap:
Each tag allocated is a bit in the mask returned, and the caller must add offset to the value to get the absolute tag value.
so like, the mask is relative. offset is the translation layer. don't forget to add it or you'll be out here reading the wrong tags and that is not the slay you want. π
π§ SEE ALSO π§
Kernel file ./include/linux/sbitmap.h, plus the whole entire friend group:
struct sbitmap_word(9)struct sbitmap(9)struct sbq_wait_state(9)struct sbitmap_queue(9)sbitmap_init_node(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_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)
that's the whole roster. go read them, they're iconic. π
okay that's the page!! mwah π β sourced from ./include/linux, dated October 2026, and that's the __sbitmap_queue_get_batch(9) manual page, signed, sealed, slayed. ππ
π¦ 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