]> www.infradead.org Git - users/hch/misc.git/commitdiff
ublk: don't dereference ublk_queue in ublk_ch_uring_cmd_local()
authorCaleb Sander Mateos <csander@purestorage.com>
Thu, 18 Sep 2025 01:49:41 +0000 (19:49 -0600)
committerJens Axboe <axboe@kernel.dk>
Sat, 20 Sep 2025 12:36:27 +0000 (06:36 -0600)
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 <csander@purestorage.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/ublk_drv.c

index 04b8613ce623f4e676a2f2ccb2736282db74db10..58f688eac7420ac778e1fabc523836f6923b8ff4 100644 (file)
@@ -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];