public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] ublk: allow off-daemon zero-copy buffer registration
@ 2025-06-06 21:40 Caleb Sander Mateos
  2025-06-06 21:40 ` [PATCH 1/8] ublk: check cmd_op first Caleb Sander Mateos
                   ` (7 more replies)
  0 siblings, 8 replies; 26+ messages in thread
From: Caleb Sander Mateos @ 2025-06-06 21:40 UTC (permalink / raw)
  To: Ming Lei; +Cc: Uday Shankar, linux-block, Caleb Sander Mateos

Currently ublk zero-copy requires ublk request buffers to be registered
and unregistered by the ublk I/O's daemon task. However, as currently
implemented, there is no reason for this restriction. Registration looks
up the request via the ublk device's tagset rather than the daemon-local
ublk_io structure and takes an atomic reference to prevent racing with
dispatch or completion of the request. Ming has expressed interest in
relaxing this restriction[1] so the ublk server can offload the I/O
operation that uses the zero-copy buffer to another thread.

Additionally, optimize the buffer registration for the common case
where the buffer is registered by the daemon task. Skip the expensive
atomic reference count increment and the several pointer dereferences
involved in looking up the request on the tagset.

A few other cleanups and optimizations are included.

[1]: https://lore.kernel.org/linux-block/aAmYJxaV1-yWEMRo@fedora/

Caleb Sander Mateos (8):
  ublk: check cmd_op first
  ublk: handle UBLK_IO_FETCH_REQ first
  ublk: remove task variable from __ublk_ch_uring_cmd()
  ublk: consolidate UBLK_IO_FLAG_{ACTIVE,OWNED_BY_SRV} checks
  ublk: move ublk_prep_cancel() to case UBLK_IO_COMMIT_AND_FETCH_REQ
  ublk: allow UBLK_IO_(UN)REGISTER_IO_BUF on any task
  ublk: optimize UBLK_IO_REGISTER_IO_BUF on daemon task
  ublk: remove ubq checks from ublk_{get,put}_req_ref()

 drivers/block/ublk_drv.c      | 169 ++++++++++++++++++++--------------
 include/uapi/linux/ublk_cmd.h |   8 ++
 2 files changed, 107 insertions(+), 70 deletions(-)

-- 
2.45.2


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

end of thread, other threads:[~2025-06-12  4:25 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-06 21:40 [PATCH 0/8] ublk: allow off-daemon zero-copy buffer registration Caleb Sander Mateos
2025-06-06 21:40 ` [PATCH 1/8] ublk: check cmd_op first Caleb Sander Mateos
2025-06-09  6:57   ` Ming Lei
2025-06-06 21:40 ` [PATCH 2/8] ublk: handle UBLK_IO_FETCH_REQ first Caleb Sander Mateos
2025-06-09  7:01   ` Ming Lei
2025-06-06 21:40 ` [PATCH 3/8] ublk: remove task variable from __ublk_ch_uring_cmd() Caleb Sander Mateos
2025-06-09  7:02   ` Ming Lei
2025-06-06 21:40 ` [PATCH 4/8] ublk: consolidate UBLK_IO_FLAG_{ACTIVE,OWNED_BY_SRV} checks Caleb Sander Mateos
2025-06-09  7:19   ` Ming Lei
2025-06-06 21:40 ` [PATCH 5/8] ublk: move ublk_prep_cancel() to case UBLK_IO_COMMIT_AND_FETCH_REQ Caleb Sander Mateos
2025-06-09  7:21   ` Ming Lei
2025-06-06 21:40 ` [PATCH 6/8] ublk: allow UBLK_IO_(UN)REGISTER_IO_BUF on any task Caleb Sander Mateos
2025-06-09  7:34   ` Ming Lei
2025-06-09 17:39     ` Caleb Sander Mateos
2025-06-09 12:34   ` Ming Lei
2025-06-09 17:49     ` Caleb Sander Mateos
2025-06-10  1:34       ` Ming Lei
2025-06-11 15:47         ` Caleb Sander Mateos
2025-06-12  2:31           ` Ming Lei
2025-06-06 21:40 ` [PATCH 7/8] ublk: optimize UBLK_IO_REGISTER_IO_BUF on daemon task Caleb Sander Mateos
2025-06-09  9:02   ` Ming Lei
2025-06-09 17:14     ` Caleb Sander Mateos
2025-06-10  1:22       ` Ming Lei
2025-06-11 15:36         ` Caleb Sander Mateos
2025-06-12  4:25           ` Ming Lei
2025-06-06 21:40 ` [PATCH 8/8] ublk: remove ubq checks from ublk_{get,put}_req_ref() Caleb Sander Mateos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox