diff options
author | Douglas Anderson <dianders@chromium.org> | 2020-04-20 19:24:52 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-04-20 19:34:56 +0300 |
commit | b9151e7bca82a17ff7aa442a168e0f924a07443c (patch) | |
tree | 7543cdcf5bddfd8020e3bdf52579648053418aea /block | |
parent | ab3cee3762e5e69f27c302c43691289fdfc12316 (diff) | |
download | linux-b9151e7bca82a17ff7aa442a168e0f924a07443c.tar.xz |
blk-mq: Add blk_mq_delay_run_hw_queues() API call
We have:
* blk_mq_run_hw_queue()
* blk_mq_delay_run_hw_queue()
* blk_mq_run_hw_queues()
...but not blk_mq_delay_run_hw_queues(), presumably because nobody
needed it before now. Since we need it for a later patch in this
series, add it.
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-mq.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index 1c4bedf500c5..cf95e8e0881a 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1546,6 +1546,25 @@ void blk_mq_run_hw_queues(struct request_queue *q, bool async) EXPORT_SYMBOL(blk_mq_run_hw_queues); /** + * blk_mq_delay_run_hw_queues - Run all hardware queues asynchronously. + * @q: Pointer to the request queue to run. + * @msecs: Microseconds of delay to wait before running the queues. + */ +void blk_mq_delay_run_hw_queues(struct request_queue *q, unsigned long msecs) +{ + struct blk_mq_hw_ctx *hctx; + int i; + + queue_for_each_hw_ctx(q, hctx, i) { + if (blk_mq_hctx_stopped(hctx)) + continue; + + blk_mq_delay_run_hw_queue(hctx, msecs); + } +} +EXPORT_SYMBOL(blk_mq_delay_run_hw_queues); + +/** * blk_mq_queue_stopped() - check whether one or more hctxs have been stopped * @q: request queue. * |