Skip to content

Commit 122f638

Browse files
calebsanderaxboe
authored andcommitted
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 <[email protected]> Reviewed-by: Ming Lei <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent be7962d commit 122f638

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/block/ublk_drv.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2267,10 +2267,10 @@ static int ublk_check_commit_and_fetch(const struct ublk_device *ub,
22672267
return 0;
22682268
}
22692269

2270-
static bool ublk_need_complete_req(const struct ublk_queue *ubq,
2270+
static bool ublk_need_complete_req(const struct ublk_device *ub,
22712271
struct ublk_io *io)
22722272
{
2273-
if (ublk_need_req_ref(ubq))
2273+
if (ublk_dev_need_req_ref(ub))
22742274
return ublk_sub_req_ref(io);
22752275
return true;
22762276
}
@@ -2387,7 +2387,7 @@ static int ublk_ch_uring_cmd_local(struct io_uring_cmd *cmd,
23872387
io->res = result;
23882388
req = ublk_fill_io_cmd(io, cmd);
23892389
ret = ublk_config_io_buf(ub, io, cmd, addr, &buf_idx);
2390-
compl = ublk_need_complete_req(ubq, io);
2390+
compl = ublk_need_complete_req(ub, io);
23912391

23922392
/* can't touch 'ublk_io' any more */
23932393
if (buf_idx != UBLK_INVALID_BUF_IDX)

0 commit comments

Comments
 (0)