]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ublk: don't access ublk_queue in ublk_register_io_buf()
authorCaleb Sander Mateos <csander@purestorage.com>
Thu, 18 Sep 2025 01:49:44 +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 in
ublk_register_io_buf() is a frequent cache miss. Get the flags from the
ublk_device instead, which is accessed earlier in
ublk_ch_uring_cmd_local().

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 cb51f3f3cd33d8f85c53ce554c184034cd3b086e..751ec62655f893838c86b477dad5b2fd0d14edc5 100644 (file)
@@ -2133,7 +2133,7 @@ static int ublk_register_io_buf(struct io_uring_cmd *cmd,
        struct request *req;
        int ret;
 
-       if (!ublk_support_zero_copy(ubq))
+       if (!ublk_dev_support_zero_copy(ub))
                return -EINVAL;
 
        req = __ublk_check_and_get_req(ub, ubq, io, 0);