Re: [PATCH] ublk: optimize ublk_queue_cmd_list() for length-1 lists
From: Jens Axboe
Date: Mon Nov 09 2026 - 16:42:59 EST
On Wed, 04 Nov 2026 19:13:49 -0700, Caleb Sander Mateos wrote:
> For a request list of length 1, ublk_cmd_list_tw_cb() is more expensive
> than ublk_cmd_tw_cb(). It loads rq_next, which is in a separate cache
> line from the other struct request fields accessed in the dispatch path.
> And it dereferences mq_hctx->driver_data to get the struct ublk_queue *,
> whereas ublk_cmd_tw_cb() gets it from struct ublk_uring_cmd_pdu
> alongside the request pointer. On the submission, ublk_queue_cmd_list()
> can cheaply check whether the request list just assembled has length 1.
> So pass ublk_cmd_tw_cb as the io_uring task work callback if the list
> has a single request and ublk_cmd_list_tw_cb if it contains multiple.
>
> [...]
Applied, thanks!
[1/1] ublk: optimize ublk_queue_cmd_list() for length-1 lists
(no commit info)
Best regards,
--
Jens Axboe