diff options
| author | Caleb Sander Mateos <csander@purestorage.com> | 2025-09-17 19:49:51 -0600 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2025-09-20 06:36:27 -0600 |
| commit | 122f6387e845dfbfcf1ed795734a1ec779e987f0 (patch) | |
| tree | 7135c4065a15b22d5a47527e733522ce77cd3eca | |
| parent | be7962d7e3d9dd9ff5b6bcd3faccb3b0f76a9734 (diff) | |
ublk: don't access ublk_queue in ublk_need_complete_req()
For ublk servers with many ublk queues, accessing the ublk_queue in
ublk_need_complete_req() 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>
| -rw-r--r-- | drivers/block/ublk_drv.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index b92b7823005d..750d0a332685 100644 --- a/drivers/block/ublk_drv.c +++ b/drivers/block/ublk_drv.c @@ -2267,10 +2267,10 @@ static int ublk_check_commit_and_fetch(const struct ublk_device *ub, return 0; } -static bool ublk_need_complete_req(const struct ublk_queue *ubq, +static bool ublk_need_complete_req(const struct ublk_device *ub, struct ublk_io *io) { - if (ublk_need_req_ref(ubq)) + if (ublk_dev_need_req_ref(ub)) return ublk_sub_req_ref(io); return true; } @@ -2387,7 +2387,7 @@ static int ublk_ch_uring_cmd_local(struct io_uring_cmd *cmd, io->res = result; req = ublk_fill_io_cmd(io, cmd); ret = ublk_config_io_buf(ub, io, cmd, addr, &buf_idx); - compl = ublk_need_complete_req(ubq, io); + compl = ublk_need_complete_req(ub, io); /* can't touch 'ublk_io' any more */ if (buf_idx != UBLK_INVALID_BUF_IDX) |
