]> git.baikalelectronics.ru Git - kernel.git/commit
blk-mq: fix performance regression with shared tags
authorJens Axboe <axboe@kernel.dk>
Tue, 20 Jun 2017 23:56:13 +0000 (17:56 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 21 Jun 2017 16:17:49 +0000 (10:17 -0600)
commitd4fd38b3145be5f879e2ac7471cd4b6c06feccea
treee407c7eb7afd9d09aea9355426a2942a295be946
parent949aae9842897488463ab80aa00ea0217ba97469
blk-mq: fix performance regression with shared tags

If we have shared tags enabled, then every IO completion will trigger
a full loop of every queue belonging to a tag set, and every hardware
queue for each of those queues, even if nothing needs to be done.
This causes a massive performance regression if you have a lot of
shared devices.

Instead of doing this huge full scan on every IO, add an atomic
counter to the main queue that tracks how many hardware queues have
been marked as needing a restart. With that, we can avoid looking for
restartable queues, if we don't have to.

Max reports that this restores performance. Before this patch, 4K
IOPS was limited to 22-23K IOPS. With the patch, we are running at
950-970K IOPS.

Fixes: 050b72ceb974 ("blk-mq: Restart a single queue if tag sets are shared")
Reported-by: Max Gurtovoy <maxg@mellanox.com>
Tested-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
Tested-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq-sched.c
block/blk-mq-sched.h
block/blk-mq.c
include/linux/blkdev.h