]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
blk-mq: only run the hardware queue if IO is pending
authorJens Axboe <axboe@kernel.dk>
Fri, 10 Nov 2017 16:13:21 +0000 (09:13 -0700)
committerJens Axboe <axboe@kernel.dk>
Sat, 11 Nov 2017 02:55:57 +0000 (19:55 -0700)
commit79f720a751cad613620d0237e3b44f89f4a69181
tree4f530507baac038f38fa6974734f3a0595b2abb1
parentf0fba398fec65ff5a2e1bf8ae62718ec0450abaf
blk-mq: only run the hardware queue if IO is pending

Currently we are inconsistent in when we decide to run the queue. Using
blk_mq_run_hw_queues() we check if the hctx has pending IO before
running it, but we don't do that from the individual queue run function,
blk_mq_run_hw_queue(). This results in a lot of extra and pointless
queue runs, potentially, on flush requests and (much worse) on tag
starvation situations. This is observable just looking at top output,
with lots of kworkers active. For the !async runs, it just adds to the
CPU overhead of blk-mq.

Move the has-pending check into the run function instead of having
callers do it.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq-sched.c
block/blk-mq.c
block/blk-mq.h
include/linux/blk-mq.h