linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/17] ublk: avoid accessing ublk_queue to handle ublksrv_io_cmd
@ 2025-09-18  1:49 Caleb Sander Mateos
  2025-09-18  1:49 ` [PATCH 01/17] ublk: remove ubq check in ublk_check_and_get_req() Caleb Sander Mateos
                   ` (18 more replies)
  0 siblings, 19 replies; 24+ messages in thread
From: Caleb Sander Mateos @ 2025-09-18  1:49 UTC (permalink / raw)
  To: Ming Lei, Jens Axboe; +Cc: linux-block, linux-kernel, Caleb Sander Mateos

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(-)

-- 
2.45.2


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2025-09-20 12:39 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-18  1:49 [PATCH 00/17] ublk: avoid accessing ublk_queue to handle ublksrv_io_cmd Caleb Sander Mateos
2025-09-18  1:49 ` [PATCH 01/17] ublk: remove ubq check in ublk_check_and_get_req() Caleb Sander Mateos
2025-09-19  3:53   ` Ming Lei
2025-09-18  1:49 ` [PATCH 02/17] ublk: don't pass q_id to ublk_queue_cmd_buf_size() Caleb Sander Mateos
2025-09-19  4:04   ` Ming Lei
2025-09-18  1:49 ` [PATCH 03/17] ublk: don't pass ublk_queue to __ublk_fail_req() Caleb Sander Mateos
2025-09-20  8:52   ` Ming Lei
2025-09-18  1:49 ` [PATCH 04/17] ublk: add helpers to check ublk_device flags Caleb Sander Mateos
2025-09-20  8:54   ` Ming Lei
2025-09-18  1:49 ` [PATCH 05/17] ublk: don't dereference ublk_queue in ublk_ch_uring_cmd_local() Caleb Sander Mateos
2025-09-18  1:49 ` [PATCH 06/17] ublk: don't dereference ublk_queue in ublk_check_and_get_req() Caleb Sander Mateos
2025-09-18  1:49 ` [PATCH 07/17] ublk: pass ublk_device to ublk_register_io_buf() Caleb Sander Mateos
2025-09-18  1:49 ` [PATCH 08/17] ublk: don't access ublk_queue in ublk_register_io_buf() Caleb Sander Mateos
2025-09-18  1:49 ` [PATCH 09/17] ublk: don't access ublk_queue in ublk_daemon_register_io_buf() Caleb Sander Mateos
2025-09-18  1:49 ` [PATCH 10/17] ublk: pass q_id and tag to __ublk_check_and_get_req() Caleb Sander Mateos
2025-09-18  1:49 ` [PATCH 11/17] ublk: don't access ublk_queue in ublk_check_fetch_buf() Caleb Sander Mateos
2025-09-18  1:49 ` [PATCH 12/17] ublk: don't access ublk_queue in ublk_config_io_buf() Caleb Sander Mateos
2025-09-18  1:49 ` [PATCH 13/17] ublk: don't pass ublk_queue to ublk_fetch() Caleb Sander Mateos
2025-09-18  1:49 ` [PATCH 14/17] ublk: don't access ublk_queue in ublk_check_commit_and_fetch() Caleb Sander Mateos
2025-09-18  1:49 ` [PATCH 15/17] ublk: don't access ublk_queue in ublk_need_complete_req() Caleb Sander Mateos
2025-09-18  1:49 ` [PATCH 16/17] ublk: pass ublk_io to __ublk_complete_rq() Caleb Sander Mateos
2025-09-18  1:49 ` [PATCH 17/17] ublk: don't access ublk_queue in ublk_unmap_io() Caleb Sander Mateos
2025-09-20  9:32 ` [PATCH 00/17] ublk: avoid accessing ublk_queue to handle ublksrv_io_cmd Ming Lei
2025-09-20 12:39 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).