sbitmap: optimise sbitmap_deferred_clear()
authorPavel Begunkov <asml.silence@gmail.com>
Sun, 22 Nov 2020 15:35:45 +0000 (15:35 +0000)
committerJens Axboe <axboe@kernel.dk>
Tue, 8 Dec 2020 00:12:49 +0000 (17:12 -0700)
commitb78beea038a3087df63bba7adaacb476a8ca95af
tree296886e70357e7c8b78718e3604126d4867c1e0e
parentf6f371f7db42917c7b2a861c4fc923cb352ce5a1
sbitmap: optimise sbitmap_deferred_clear()

Because of spinlocks and atomics sbitmap_deferred_clear() have to reload
&sb->map[index] on each access even though the map address won't change.
Pass in sbitmap_word instead of {sb, index}, so it's cached in a
variable. It also improves code generation of
sbitmap_find_bit_in_index().

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Reviewed-by: John Garry <john.garry@huawei.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
lib/sbitmap.c