Skip to content

Commit

Permalink
block: Initialize bio priority earlier
Browse files Browse the repository at this point in the history
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 <[email protected]>
Tested-by: Damien Le Moal <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
jankara authored and axboe committed Jun 27, 2022
1 parent 82b74ca commit 9c6227e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions block/blk-mq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
Expand Down

0 comments on commit 9c6227e

Please sign in to comment.