]> git.baikalelectronics.ru Git - kernel.git/commit
lib/sbitmap: kill 'depth' from sbitmap_word
authorMing Lei <ming.lei@redhat.com>
Mon, 10 Jan 2022 07:29:45 +0000 (15:29 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 8 Feb 2022 13:54:50 +0000 (06:54 -0700)
commite10ba1d529b7ffd7e9c288976ea978640d65e2e9
tree3f5eb173048d91b9bba51bf1457028ca2620fb60
parent9040fe8a4fcf69575abe80978adc63490b66da0e
lib/sbitmap: kill 'depth' from sbitmap_word

Only the last sbitmap_word can have different depth, and all the others
must have same depth of 1U << sb->shift, so not necessary to store it in
sbitmap_word, and it can be retrieved easily and efficiently by adding
one internal helper of __map_depth(sb, index).

Remove 'depth' field from sbitmap_word, then the annotation of
____cacheline_aligned_in_smp for 'word' isn't needed any more.

Not see performance effect when running high parallel IOPS test on
null_blk.

This way saves us one cacheline(usually 64 words) per each sbitmap_word.

Cc: Martin Wilck <martin.wilck@suse.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: John Garry <john.garry@huawei.com>
Link: https://lore.kernel.org/r/20220110072945.347535-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/sbitmap.h
lib/sbitmap.c