mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-22 23:13:01 +02:00
block: Reorder the request allocation code in blk_mq_submit_bio()
Help the CPU branch predictor in case of a cache hit by handling the cache hit scenario first. Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Link: https://lore.kernel.org/r/20241218212246.1073149-2-bvanassche@acm.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
e7b94c5c6f
commit
44e4138159
|
@ -3125,12 +3125,12 @@ void blk_mq_submit_bio(struct bio *bio)
|
|||
goto queue_exit;
|
||||
|
||||
new_request:
|
||||
if (!rq) {
|
||||
if (rq) {
|
||||
blk_mq_use_cached_rq(rq, plug, bio);
|
||||
} else {
|
||||
rq = blk_mq_get_new_requests(q, plug, bio, nr_segs);
|
||||
if (unlikely(!rq))
|
||||
goto queue_exit;
|
||||
} else {
|
||||
blk_mq_use_cached_rq(rq, plug, bio);
|
||||
}
|
||||
|
||||
trace_block_getrq(bio);
|
||||
|
|
Loading…
Reference in New Issue
Block a user