]> git.baikalelectronics.ru Git - 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)
commit7cba087fcfc03baff533e2a7291431d220aab6b4
tree4f530507baac038f38fa6974734f3a0595b2abb1
parent286b13aa098cc683829a9cf961fcb97d80cfc2a5
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