Skip to content

ublk: cleanup for supporting batch IO command

Ming Lei linux-block 3 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest17 patches 7 repliesApplied
  2. v216 patches 6 repliesSuperseded
  3. v116 patches 12 repliesSuperseded

Changes in v3 from the cover letter

- add patch "ublk: validate ublk server pid"
- clean "ublk: let ublk_fill_io_cmd() cover more things" by not setting io->res in ublk_fill_io_cmd()
- improve commit log
- misc patch style fix
- add reviewed-by tag

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/17ublk: validate ublk server piddrivers/block/ublk_drv.c+9 -04 replies
2/17ublk: look up ublk task via its pid in timeout handlerdrivers/block/ublk_drv.c+17 -80 replies
3/17ublk: move fake timeout logic into __ublk_complete_rq()drivers/block/ublk_drv.c+1 -40 replies
4/17ublk: let ublk_fill_io_cmd() cover more thingsdrivers/block/ublk_drv.c+2 -41 reply
5/17ublk: avoid to pass `struct ublksrv_io_cmd *` to ublk_commit_and_fetch()drivers/block/ublk_drv.c+29 -150 replies
6/17ublk: move auto buffer register handling into one dedicated helperdrivers/block/ublk_drv.c+71 -560 replies
7/17ublk: store auto buffer register data into `struct ublk_io`drivers/block/ublk_drv.c+12 -180 replies
8/17ublk: add helper ublk_check_fetch_buf()drivers/block/ublk_drv.c+19 -130 replies
9/17ublk: remove ublk_commit_and_fetch()drivers/block/ublk_drv.c+18 -181 reply
10/17ublk: pass 'const struct ublk_io *' to ublk_[un]map_io()drivers/block/ublk_drv.c+2 -20 replies
11/17selftests: ublk: remove `tag` parameter of ->tgt_io_done()tools/testing/selftests/ublk/fault_inject.c tools/testing/selftests/ublk/file_backed.c tools/testing/selftests/ublk/kublk.c +3 more+10 -90 replies
12/17selftests: ublk: pass 'ublk_thread *' to ->queue_io() and ->tgt_io_done()tools/testing/selftests/ublk/fault_inject.c tools/testing/selftests/ublk/file_backed.c tools/testing/selftests/ublk/kublk.c +3 more+58 -440 replies
13/17selftests: ublk: pass 'ublk_thread *' to more common helperstools/testing/selftests/ublk/fault_inject.c tools/testing/selftests/ublk/file_backed.c tools/testing/selftests/ublk/kublk.c +3 more+28 -290 replies
14/17selftests: ublk: remove ublk queue self-defined flagstools/testing/selftests/ublk/kublk.c tools/testing/selftests/ublk/kublk.h tools/testing/selftests/ublk/null.c+25 -240 replies
15/17selftests: ublk: improve flags namingtools/testing/selftests/ublk/kublk.c tools/testing/selftests/ublk/kublk.h+29 -320 replies
16/17selftests: ublk: add helper ublk_handle_uring_cmd() for handle ublk commandtools/testing/selftests/ublk/kublk.c+34 -270 replies
17/17selftests: ublk: add utils.htools/testing/selftests/ublk/kublk.h tools/testing/selftests/ublk/utils.h+72 -620 replies

Reviews trailers per patch

8 of 17 patches have a Reviewed-by or Acked-by.

PatchCaleb Sander Mateos
1/17
2/17
3/17R-b
4/17R-b
5/17R-b
6/17R-b
7/17R-b
8/17R-b
9/17R-b
10/17R-b
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 v3 thread

Cover letter [PATCH V3 00/17] ublk: cleanup for supporting batch IO command

Hi Jens,

The 1st 9 patches cleans ublk driver, and prepare for supporting batch IO command which needs per-io lock.

The others are selftest cleanup, and prepare for supporting arbitrary task context & ublk queue combination, which will be allowed with batch IO feature.

ublk Batch IO feature introduction:

- use per-queue multshot uring_cmd for fetching incoming io commands, and io command tag is saved to provided buffer

- use per-queue uring_cmd for completing io command result, and io tag & result are filled in uring_cmd buffer

- this way improves communication efficiency, also:

- allows each queue to be handled in any pthread contexts, and each pthread context can handle any number of queues, and driver doesn't care ublk server context any more

- help to apply blk-mq batch optimization in future

- help to support io polling in future

- github:

https://github.com/ming1/linux/commits/ublk2-cmd-batch.v3/

Almost all feedback are from Caleb, and great thanks Caleb's review!

V3:
- add patch "ublk: validate ublk server pid"
- clean "ublk: let ublk_fill_io_cmd() cover more things" by not setting io->res in ublk_fill_io_cmd()
- improve commit log
- misc patch style fix
- add reviewed-by tag

V2:
- remove one unnecessary check (Caleb Sander Mateos)
- add reviewed-by tag
- rebase on latest for-6.17/block

Ming Lei (17):
ublk: validate ublk server pid
ublk: look up ublk task via its pid in timeout handler
ublk: move fake timeout logic into __ublk_complete_rq()
ublk: let ublk_fill_io_cmd() cover more things
ublk: avoid to pass struct ublksrv_io_cmd * to
ublk_commit_and_fetch()
ublk: move auto buffer register handling into one dedicated helper
ublk: store auto buffer register data into struct ublk_io
ublk: add helper ublk_check_fetch_buf()
ublk: remove ublk_commit_and_fetch()
ublk: pass 'const struct ublk_io *' to ublk_[un]map_io()
selftests: ublk: remove tag parameter of ->tgt_io_done()
selftests: ublk: pass 'ublk_thread *' to ->queue_io() and

    ->tgt_io_done()

selftests: ublk: pass 'ublk_thread *' to more common helpers
selftests: ublk: remove ublk queue self-defined flags
selftests: ublk: improve flags naming
selftests: ublk: add helper ublk_handle_uring_cmd() for handle ublk
command
selftests: ublk: add utils.h

 drivers/block/ublk_drv.c                    | 254 ++++++++++++--------
 tools/testing/selftests/ublk/fault_inject.c |  15 +-
 tools/testing/selftests/ublk/file_backed.c  |  32 +--
 tools/testing/selftests/ublk/kublk.c        | 140 ++++++-----
 tools/testing/selftests/ublk/kublk.h        | 135 ++++-------
 tools/testing/selftests/ublk/null.c         |  32 +--
 tools/testing/selftests/ublk/stripe.c       |  33 +--
 tools/testing/selftests/ublk/utils.h        |  70 ++++++
 8 files changed, 391 insertions(+), 320 deletions(-)
 create mode 100644 tools/testing/selftests/ublk/utils.h
Signature · 1 line
2.47.0