From: Caleb Sander Mateos Date: Thu, 18 Sep 2025 01:49:41 +0000 (-0600) Subject: ublk: don't dereference ublk_queue in ublk_ch_uring_cmd_local() X-Git-Tag: v6.18-rc1~136^2~20 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5125535f90564117506d926d0de92c4c2622b720;p=thirdparty%2Fkernel%2Flinux.git ublk: don't dereference ublk_queue in ublk_ch_uring_cmd_local() For ublk servers with many ublk queues, accessing the ublk_queue to handle a ublk command is a frequent cache miss. Get the queue depth from the ublk_device instead, which is accessed just before. Signed-off-by: Caleb Sander Mateos Reviewed-by: Ming Lei Signed-off-by: Jens Axboe --- diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index 04b8613ce623f..58f688eac7420 100644 --- a/drivers/block/ublk_drv.c +++ b/drivers/block/ublk_drv.c @@ -2333,7 +2333,7 @@ static int ublk_ch_uring_cmd_local(struct io_uring_cmd *cmd, ubq = ublk_get_queue(ub, q_id); - if (tag >= ubq->q_depth) + if (tag >= ub->dev_info.queue_depth) goto out; io = &ubq->ios[tag];