BITMAP INTRODUCTION(9)
π bitmap introduction π
okay so bestie, welcome to the Kernel API Manual entry for bitmap introduction(9) β this one is lowkey foundational and honestly kinda iconic. πβ¨
bitmaps are literally an array of bits, implemented using an array of unsigned longs. Thatβs the whole vibe. The number of valid bits in a given bitmap does not need to be an exact multiple of BITS_PER_LONG β no cap, it really doesnβt. π
The possible unused bits in the last, partially used word of a bitmap are 'don't care'. The implementation makes no particular effort to keep them zero. It ensures that their value will not affect the results of any operation. The bitmap operations that return Boolean (bitmap_empty, for example) or scalar (bitmap_weight, for example) results carefully filter out these unused bits from impacting their results. fr fr, theyβre not letting those stray bits mess up the answer. π«Ά
The byte ordering of bitmaps is more natural on little endian architectures. See the big-endian headers include/asm-ppc64/bitops.h and include/asm-s390/bitops.h for the best explanations of this ordering. π
π SEE ALSO π
Kernel file ./lib/bitmap.c β and the whole reference squad is: __bitmap_shift_right(9), __bitmap_shift_left(9), bitmap_cut(9), bitmap_find_next_zero_area_off(9), bitmap_pos_to_ord(9), bitmap_remap(9), bitmap_bitremap(9), bitmap_onto(9), bitmap_fold(9), bitmap_from_arr32(9), bitmap_to_arr32(9), bitmap_from_arr64(9), bitmap_to_arr64(9). πβ¨
okay thatβs the whole page, bestie: bitmap introduction(9) from the Kernel API Manual, source/version ./lib, dated October 2026. stay iconic, hydrate, and may your unused bits stay out of your results. π
ππ¦π
π¦ 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