aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2018-01-11 14:01:56 +0800
committerMike Snitzer <snitzer@redhat.com>2018-01-11 16:34:06 -0500
commitc50de17c1cc7d5910df58aba9b950e99579e239d (patch)
tree6e3d0fe9199bf8f28baa634658e947c63ccba683
parent64e4e12bf474cf3aaaf59245bbeba3057d2fedf9 (diff)
downloadlinux-dm-c50de17c1cc7d5910df58aba9b950e99579e239d.tar.gz
dm mpath: return DM_MAPIO_REQUEUE on blk-mq rq allocation failure
Notice: this object is not reachable from any branch.
blk-mq will rerun queue via RESTART or dispatch wake after one request is completed, so not necessary to wait random time for requeuing, we should trust blk-mq to do it. More importantly, we need to return BLK_STS_RESOURCE to blk-mq so that dequeuing from the I/O scheduler can be stopped, this results in improved I/O merging. 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.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index 3ab5f7a81e5fa..815de2b091a55 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -532,8 +532,20 @@ static int multipath_clone_and_map(struct dm_target *ti, struct request *rq,
if (blk_queue_dying(q)) {
atomic_inc(&m->pg_init_in_progress);
activate_or_offline_path(pgpath);
+ return DM_MAPIO_DELAY_REQUEUE;
}
- return DM_MAPIO_DELAY_REQUEUE;
+
+ /*
+ * blk-mq's SCHED_RESTART can cover this requeue, so we
+ * needn't deal with it by DELAY_REQUEUE. More importantly,
+ * we have to return DM_MAPIO_REQUEUE so that blk-mq can
+ * get the queue busy feedback (via BLK_STS_RESOURCE),
+ * otherwise I/O merging can suffer.
+ */
+ if (q->mq_ops)
+ return DM_MAPIO_REQUEUE;
+ else
+ return DM_MAPIO_DELAY_REQUEUE;
}
clone->bio = clone->biotail = NULL;
clone->rq_disk = bdev->bd_disk;