]> git.baikalelectronics.ru Git - kernel.git/commit
sbitmap: Consider cleared bits in sbitmap_bitmap_show()
authorJohn Garry <john.garry@huawei.com>
Wed, 1 Jul 2020 08:06:25 +0000 (16:06 +0800)
committerJens Axboe <axboe@kernel.dk>
Wed, 1 Jul 2020 16:53:00 +0000 (10:53 -0600)
commit9e9f400106d4c262e47c33b818dfda3f2c6153ef
tree4205235a563d9b9558ddde2963ffce95e5f7aafc
parentce4ab0e510c62b20cdfd4e781397e302a73f436d
sbitmap: Consider cleared bits in sbitmap_bitmap_show()

sbitmap works by maintaining separate bitmaps of set and cleared bits.
The set bits are cleared in a batch, to save the burden of continuously
locking the "word" map to unset.

sbitmap_bitmap_show() only shows the set bits (in "word"), which is not
too much use, so mask out the cleared bits.

Fixes: adc0132cb100 ("sbitmap: ammortize cost of clearing bits")
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
lib/sbitmap.c