diff options
| author | Ming Lei <ming.lei@redhat.com> | 2018-01-11 14:01:55 +0800 |
|---|---|---|
| committer | Mike Snitzer <snitzer@redhat.com> | 2018-01-11 16:23:28 -0500 |
| commit | 64e4e12bf474cf3aaaf59245bbeba3057d2fedf9 (patch) | |
| tree | b3c82c5496a7ccb92c3f71d3ff24bd90b7c22f6e | |
| parent | deaf9bd644c88564630eac46eeea1778f01ce33a (diff) | |
| download | linux-dm-64e4e12bf474cf3aaaf59245bbeba3057d2fedf9.tar.gz | |
dm mpath: don't call blk_mq_delay_run_hw_queue() in case of BLK_STS_RESOURCE
Notice: this object is not reachable from any branch.
If .queue_rq() returns BLK_STS_RESOURCE, blk-mq will rerun the queue in
these three situations:
1) if BLK_MQ_S_SCHED_RESTART is set
- queue is rerun after one rq is completed, see blk_mq_sched_restart()
which is run from blk_mq_free_request()
2) run out of driver tag
- queue is rerun after one tag is freed
3) otherwise
- queue is run immediately in blk_mq_dispatch_rq_list()
dm-mpath's random (100ms) delayed running of hw queue was introduced by
commit 6077c2d706097c0 ("dm rq: Avoid that request processing stalls
sporadically"), but it never explained the reasoning behind it. At best
it was a workaround. And calling blk_mq_delay_run_hw_queue() inside
.queue_rq() is a horrible hack because it breaks BLK_MQ_S_SCHED_RESTART,
which degrades I/O peformance a lot. So remove it.
Also, avoid using DM_MAPIO_REQUEUE unless absolutely necessary because
it results in dm-rq.c:dm_mq_queue_rq() returning BLK_STS_RESOURCE to
blk-mq -- doing so should only ever be done if the underlying queue is
out of resources. So switch to returning DM_MAPIO_DELAY_REQUEUE if
either MPATHF_QUEUE_IO or MPATHF_PG_INIT_REQUIRED is set in
multipath_clone_and_map().
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Notice: this object is not reachable from any branch.
| -rw-r--r-- | drivers/md/dm-mpath.c | 5 | ||||
| -rw-r--r-- | drivers/md/dm-rq.c | 1 |
2 files changed, 2 insertions, 4 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index be581765edd1f..3ab5f7a81e5fa 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -517,9 +517,8 @@ static int multipath_clone_and_map(struct dm_target *ti, struct request *rq, return DM_MAPIO_KILL; } else if (test_bit(MPATHF_QUEUE_IO, &m->flags) || test_bit(MPATHF_PG_INIT_REQUIRED, &m->flags)) { - if (pg_init_all_paths(m)) - return DM_MAPIO_DELAY_REQUEUE; - return DM_MAPIO_REQUEUE; + pg_init_all_paths(m); + return DM_MAPIO_DELAY_REQUEUE; } mpio->pgpath = pgpath; diff --git a/drivers/md/dm-rq.c b/drivers/md/dm-rq.c index 9d32f25489c27..cbe8a06ef8b01 100644 --- a/drivers/md/dm-rq.c +++ b/drivers/md/dm-rq.c @@ -758,7 +758,6 @@ static blk_status_t dm_mq_queue_rq(struct blk_mq_hw_ctx *hctx, /* Undo dm_start_request() before requeuing */ rq_end_stats(md, rq); rq_completed(md, rq_data_dir(rq), false); - blk_mq_delay_run_hw_queue(hctx, 100/*ms*/); return BLK_STS_RESOURCE; } |
