]> git.baikalelectronics.ru Git - kernel.git/commit
block: improve batched tag allocation
authorJens Axboe <axboe@kernel.dk>
Sat, 9 Oct 2021 19:10:39 +0000 (13:10 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 18 Oct 2021 12:17:35 +0000 (06:17 -0600)
commit2e06575d9cdea32b03763c1d03500481d49b7f3c
tree3d8049f24e9c7f2c32ef7ae88322d6828d50af59
parent1deeb5d73a89a559b554ce644c7b889f4226d3fe
block: improve batched tag allocation

Add a blk_mq_get_tags() helper, which uses the new sbitmap API for
allocating a batch of tags all at once. This both simplifies the block
code for batched allocation, and it is also more efficient than just
doing repeated calls into __sbitmap_queue_get().

This reduces the sbitmap overhead in peak runs from ~3% to ~1% and
yields a performanc increase from 6.6M IOPS to 6.8M IOPS for a single
CPU core.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq-tag.c
block/blk-mq-tag.h
block/blk-mq.c