Skip to content

ublk: avoid accessing ublk_queue to handle ublksrv_io_cmd

Caleb Sander Mateos linux-block lkml 1 version Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest17 patches 6 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/17ublk: remove ubq check in ublk_check_and_get_req()drivers/block/ublk_drv.c+0 -31 reply
2/17ublk: don't pass q_id to ublk_queue_cmd_buf_size()drivers/block/ublk_drv.c+5 -71 reply
3/17ublk: don't pass ublk_queue to __ublk_fail_req()drivers/block/ublk_drv.c+3 -31 reply
4/17ublk: add helpers to check ublk_device flagsdrivers/block/ublk_drv.c+34 -01 reply
5/17ublk: don't dereference ublk_queue in ublk_ch_uring_cmd_local()drivers/block/ublk_drv.c+1 -10 replies
6/17ublk: don't dereference ublk_queue in ublk_check_and_get_req()drivers/block/ublk_drv.c+2 -20 replies
7/17ublk: pass ublk_device to ublk_register_io_buf()drivers/block/ublk_drv.c+6 -40 replies
8/17ublk: don't access ublk_queue in ublk_register_io_buf()drivers/block/ublk_drv.c+1 -10 replies
9/17ublk: don't access ublk_queue in ublk_daemon_register_io_buf()drivers/block/ublk_drv.c+1 -10 replies
10/17ublk: pass q_id and tag to __ublk_check_and_get_req()drivers/block/ublk_drv.c+11 -130 replies
11/17ublk: don't access ublk_queue in ublk_check_fetch_buf()drivers/block/ublk_drv.c+4 -40 replies
12/17ublk: don't access ublk_queue in ublk_config_io_buf()drivers/block/ublk_drv.c+5 -50 replies
13/17ublk: don't pass ublk_queue to ublk_fetch()drivers/block/ublk_drv.c+2 -30 replies
14/17ublk: don't access ublk_queue in ublk_check_commit_and_fetch()drivers/block/ublk_drv.c+4 -40 replies
15/17ublk: don't access ublk_queue in ublk_need_complete_req()drivers/block/ublk_drv.c+3 -30 replies
16/17ublk: pass ublk_io to __ublk_complete_rq()drivers/block/ublk_drv.c+5 -60 replies
17/17ublk: don't access ublk_queue in ublk_unmap_io()drivers/block/ublk_drv.c+14 -100 replies

Reviews trailers per patch

4 of 17 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMing Lei
SeriesR-b
1/17R-b
2/17R-b
3/17R-b
4/17R-b
5/17
6/17
7/17
8/17
9/17
10/17
11/17
12/17
13/17
14/17
15/17
16/17
17/17

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/17] ublk: avoid accessing ublk_queue to handle ublksrv_io_cmd

For ublk servers with many ublk queues, accessing the ublk_queue in ublk_ch_uring_cmd_local() and the functions it calls is a frequent cache miss. The ublk_queue is only accessed for its q_depth and flags, which are also available on ublk_device. And ublk_device is already accessed for nr_hw_queues, so it will already be cached. Unfortunately, the UBLK_IO_NEED_GET_DATA path still needs to access the ublk_queue for io_cmd_buf, so it's not possible to avoid accessing the ublk_queue there. (Allocating a single io_cmd_buf for all of a ublk_device's I/Os could be done in the future.) At least we can optimize UBLK_IO_FETCH_REQ, UBLK_IO_COMMIT_AND_FETCH_REQ, UBLK_IO_REGISTER_IO_BUF, and UBLK_IO_UNREGISTER_IO_BUF.
Using only the ublk_device and not the ublk_queue in ublk_dispatch_req() is also possible, but left for a future change.

Caleb Sander Mateos (17):
ublk: remove ubq check in ublk_check_and_get_req()
ublk: don't pass q_id to ublk_queue_cmd_buf_size()
ublk: don't pass ublk_queue to __ublk_fail_req()
ublk: add helpers to check ublk_device flags
ublk: don't dereference ublk_queue in ublk_ch_uring_cmd_local()
ublk: don't dereference ublk_queue in ublk_check_and_get_req()
ublk: pass ublk_device to ublk_register_io_buf()
ublk: don't access ublk_queue in ublk_register_io_buf()
ublk: don't access ublk_queue in ublk_daemon_register_io_buf()
ublk: pass q_id and tag to __ublk_check_and_get_req()
ublk: don't access ublk_queue in ublk_check_fetch_buf()
ublk: don't access ublk_queue in ublk_config_io_buf()
ublk: don't pass ublk_queue to ublk_fetch()
ublk: don't access ublk_queue in ublk_check_commit_and_fetch()
ublk: don't access ublk_queue in ublk_need_complete_req()
ublk: pass ublk_io to __ublk_complete_rq()
ublk: don't access ublk_queue in ublk_unmap_io()

 drivers/block/ublk_drv.c | 155 +++++++++++++++++++++++----------------
 1 file changed, 93 insertions(+), 62 deletions(-)
Signature · 1 line
2.45.2