]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ublk: move cold paths out of __ublk_batch_dispatch() for icache efficiency
authorMing Lei <ming.lei@redhat.com>
Wed, 18 Mar 2026 01:41:12 +0000 (09:41 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 23 Mar 2026 01:03:52 +0000 (19:03 -0600)
commit24d4c90286b9a36a2b72d1e0ceeae237d427f975
treeab2a1d56391bfc06432fedc4cf954494f6d33731
parent713db70d6dc095d983be9a7576cb0e6d9eb7678c
ublk: move cold paths out of __ublk_batch_dispatch() for icache efficiency

Mark ublk_filter_unused_tags() as noinline since it is only called from
the unlikely(needs_filter) branch. Extract the error-handling block from
__ublk_batch_dispatch() into a new noinline ublk_batch_dispatch_fail()
function to keep the hot path compact and icache-friendly. This also
makes __ublk_batch_dispatch() more readable by separating the error
recovery logic from the normal dispatch flow.

Before: __ublk_batch_dispatch is ~1419 bytes
After:  __ublk_batch_dispatch is ~1090 bytes (-329 bytes, -23%)

Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://patch.msgid.link/20260318014112.3125432-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/ublk_drv.c