Re: [PATCH 4/6] ublk: initialize io_desc on daemon task

Ming Lei <[email protected]> Thu, 30 Jul 2026 10:10:37 -0500
Newsgroups org.kernel.vger.linux-block,org.kernel.vger.linux-kernel
Message-ID <amtpbb27v0BlRYV5@fedora-laptop>
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 <[email protected]>

Reviewed-by: Ming Lei <[email protected]>


Thanks, 
Ming