Commit 7392f29e authored by Omar Sandoval's avatar Omar Sandoval Committed by Thadeu Lima de Souza Cascardo

blk-mq: really fix plug list flushing for nomerge queues

BugLink: https://bugs.launchpad.net/bugs/1657281

Commit 0809e3ac ("block: fix plug list flushing for nomerge queues")
updated blk_mq_make_request() to set request_count even when
blk_queue_nomerges() returns true. However, blk_mq_make_request() only
does limited plugging and doesn't use request_count;
blk_sq_make_request() is the one that should have been fixed. Do that
and get rid of the unnecessary work in the mq version.

Fixes: 0809e3ac ("block: fix plug list flushing for nomerge queues")
Signed-off-by: default avatarOmar Sandoval <osandov@fb.com>
Reviewed-by: default avatarMing Lei <tom.leiming@gmail.com>
Reviewed-by: default avatarJeff Moyer <jmoyer@redhat.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
(cherry picked from commit 87c279e6)
Signed-off-by: default avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Acked-by: default avatarLuis Henriques <luis.henriques@canonical.com>
Acked-by: default avatarStefan Bader <stefan.bader@canonical.com>
parent 362a958e
...@@ -1304,12 +1304,9 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) ...@@ -1304,12 +1304,9 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio)
blk_queue_split(q, &bio, q->bio_split); blk_queue_split(q, &bio, q->bio_split);
if (!is_flush_fua && !blk_queue_nomerges(q)) { if (!is_flush_fua && !blk_queue_nomerges(q) &&
if (blk_attempt_plug_merge(q, bio, &request_count, blk_attempt_plug_merge(q, bio, &request_count, &same_queue_rq))
&same_queue_rq))
return BLK_QC_T_NONE; return BLK_QC_T_NONE;
} else
request_count = blk_plug_queued_count(q);
rq = blk_mq_map_request(q, bio, &data); rq = blk_mq_map_request(q, bio, &data);
if (unlikely(!rq)) if (unlikely(!rq))
...@@ -1400,9 +1397,11 @@ static blk_qc_t blk_sq_make_request(struct request_queue *q, struct bio *bio) ...@@ -1400,9 +1397,11 @@ static blk_qc_t blk_sq_make_request(struct request_queue *q, struct bio *bio)
blk_queue_split(q, &bio, q->bio_split); blk_queue_split(q, &bio, q->bio_split);
if (!is_flush_fua && !blk_queue_nomerges(q) && if (!is_flush_fua && !blk_queue_nomerges(q)) {
blk_attempt_plug_merge(q, bio, &request_count, NULL)) if (blk_attempt_plug_merge(q, bio, &request_count, NULL))
return BLK_QC_T_NONE; return BLK_QC_T_NONE;
} else
request_count = blk_plug_queued_count(q);
rq = blk_mq_map_request(q, bio, &data); rq = blk_mq_map_request(q, bio, &data);
if (unlikely(!rq)) if (unlikely(!rq))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment