From: Jan Kara Date: Thu, 23 Jun 2022 07:48:33 +0000 (+0200) Subject: block: Initialize bio priority earlier X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=9c6227e04355a430aa59709bbf869d9126112d0d;p=linux.git block: Initialize bio priority earlier Bio's IO priority needs to be initialized before we try to merge the bio with other bios. Otherwise we could merge bios which would otherwise receive different IO priorities leading to possible QoS issues. Reviewed-by: Damien Le Moal Tested-by: Damien Le Moal Signed-off-by: Jan Kara Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220623074840.5960-8-jack@suse.cz Signed-off-by: Jens Axboe --- diff --git a/block/blk-mq.c b/block/blk-mq.c index 4c4944b6f520..c0ec1938feee 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2814,6 +2814,8 @@ void blk_mq_submit_bio(struct bio *bio) if (!bio_integrity_prep(bio)) return; + bio_set_ioprio(bio); + rq = blk_mq_get_cached_request(q, plug, &bio, nr_segs); if (!rq) { if (!bio) @@ -2825,8 +2827,6 @@ void blk_mq_submit_bio(struct bio *bio) trace_block_getrq(bio); - bio_set_ioprio(bio); - rq_qos_track(q, rq, bio); blk_mq_bio_to_request(rq, bio, nr_segs);