Re: [PATCH 4/6] ublk: initialize io_desc on daemon task
From: Ming Lei
Date: Thu Jul 30 2026 - 12:50:05 EST
On Tue, Jul 28, 2026 at 07:29:49PM -0600, Caleb Sander Mateos wrote:
> ublk_setup_iod() is currently called to populate struct ublksrv_io_desc
> on the thread submitting I/O to a ublk device. However, only the ublk
> server threads read the io_descs. This basically guarantees a cache miss
> on both threads for each ublk I/O. There's really no need to initialize
> the io_descs on the submitting thread. Move the ublk_setup_iod() call to
> ublk_dispatch_req() (for non-UBLK_F_BATCH_IO) and
> __ublk_batch_prep_dispatch() (for UBLK_F_BATCH_IO), which runs on the
> ublk server daemon thread before dispatching the I/O to userspace.
>
> Signed-off-by: Caleb Sander Mateos <csander@xxxxxxxxxxxxxxx>
Reviewed-by: Ming Lei <tom.leiming@xxxxxxxxx>
Thanks,
Ming