block: Reorder the request allocation code in blk_mq_submit_bio()
authorBart Van Assche <bvanassche@acm.org>
Wed, 18 Dec 2024 21:22:45 +0000 (13:22 -0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 14 Jan 2025 17:13:25 +0000 (10:13 -0700)
commit44e41381591dc5b4ea67a9f170b4ec85c817586e
tree66bf9f485c1eb1ae482d7069d8042aa33cd6030b
parente7b94c5c6f3b6435206f0e4ef7c5aa4eceae42f9
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>
block/blk-mq.c