Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

block: skip q->rq_qos check in rq_qos_done_bio()

If a bio has BIO_QOS_THROTTLED or BIO_QOS_MERGED set,
it implicitly guarantees that q->rq_qos is present.
Avoid re-checking q->rq_qos in this case and call
__rq_qos_done_bio() directly as a minor optimization.

Suggested-by : Yu Kuai <yukuai1@huaweicloud.com>

Signed-off-by: Nilay Shroff <nilay@linux.ibm.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Yu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20250814082612.500845-2-nilay@linux.ibm.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Nilay Shroff and committed by
Jens Axboe
27533287 2d82f3bd

+8 -2
+8 -2
block/blk-rq-qos.h
··· 142 142 bio->bi_bdev && (bio_flagged(bio, BIO_QOS_THROTTLED) || 143 143 bio_flagged(bio, BIO_QOS_MERGED))) { 144 144 struct request_queue *q = bdev_get_queue(bio->bi_bdev); 145 - if (q->rq_qos) 146 - __rq_qos_done_bio(q->rq_qos, bio); 145 + 146 + /* 147 + * If a bio has BIO_QOS_xxx set, it implicitly implies that 148 + * q->rq_qos is present. So, we skip re-checking q->rq_qos 149 + * here as an extra optimization and directly call 150 + * __rq_qos_done_bio(). 151 + */ 152 + __rq_qos_done_bio(q->rq_qos, bio); 147 153 } 148 154 } 149 155