Skip to content

ublk: simplify & improve IO canceling

Ming Lei linux-block 2 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. v2 Latest8 patches 7 repliesApplied
  2. v19 patches 22 repliesSuperseded

Changes in v2 from the cover letter

- drop 1st patch in V1, which isn't necessary
- update "ublk: properly serialize all FETCH_REQs", which puts FETCH handling into single function, add comment on NONBLOCK
- comment & commit log improvement
- small cleanup from 5/8, 6/8

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/8ublk: properly serialize all FETCH_REQsdrivers/block/ublk_drv.c+49 -280 replies
2/8ublk: add ublk_force_abort_dev()drivers/block/ublk_drv.c+8 -130 replies
3/8ublk: rely on ->canceling for dealing with ublk_nosrv_dev_should_queue_iodrivers/block/ublk_drv.c+17 -141 reply
4/8ublk: move device reset into ublk_ch_release()drivers/block/ublk_drv.c+72 -492 replies
5/8ublk: improve detection and handling of ublk server exitdrivers/block/ublk_drv.c+123 -1001 reply
6/8ublk: remove __ublk_quiesce_dev()drivers/block/ublk_drv.c+2 -170 replies
7/8ublk: simplify aborting ublk requestdrivers/block/ublk_drv.c+20 -620 replies
8/8selftests: ublk: add generic_06 for covering fault injecttools/testing/selftests/ublk/Makefile tools/testing/selftests/ublk/fault_inject.c tools/testing/selftests/ublk/kublk.c +2 more+155 -30 replies

Reviews trailers per patch

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

PatchUday Shankar
1/8
2/8R-b
3/8R-b
4/8
5/8
6/8R-b
7/8R-b
8/8

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

Read the v2 thread

Cover letter [PATCH V2 0/8] ublk: simplify & improve IO canceling

Hello,

Patch 1st ~ 7th simplifies & improves IO canceling when ublk server daemon is exiting by taking two stage canceling:

- canceling active uring_cmd from its cancel function

- move inflight requests aborting into ublk char device release handler

With this way, implementation is simplified a lot, meantime ub->mutex is not required before queue becomes quiesced, so forward progress is guaranteed.

This approach & main implementation is from Uday's patch of "improve detection and handling of ublk server exit".

The last patch is selftest code for showing the improvement ublk server exit, 30sec timeout is avoided, which depends on patchset of "[PATCH V2 00/13] selftests: ublk: test cleanup & add more tests"[1].

[1] https://lore.kernel.org/linux-block/[email protected]/T/#medbf7024e57beaf1c53e4cef6e076421463839d0

Pass both ublk kernel selftests and ublksrv 'make test T=generic'.

Thanks,

V2:
- drop 1st patch in V1, which isn't necessary
- update "ublk: properly serialize all FETCH_REQs", which puts FETCH handling into single function, add comment on NONBLOCK
- comment & commit log improvement
- small cleanup from 5/8, 6/8

Ming Lei (5):
ublk: add ublk_force_abort_dev()
ublk: rely on ->canceling for dealing with
ublk_nosrv_dev_should_queue_io
ublk: move device reset into ublk_ch_release()
ublk: remove __ublk_quiesce_dev()
ublk: simplify aborting ublk request

Uday Shankar (3):
ublk: properly serialize all FETCH_REQs
ublk: improve detection and handling of ublk server exit
selftests: ublk: add generic_06 for covering fault inject

 drivers/block/ublk_drv.c                      | 532 +++++++++---------
 tools/testing/selftests/ublk/Makefile         |   4 +-
 tools/testing/selftests/ublk/fault_inject.c   |  98 ++++
 tools/testing/selftests/ublk/kublk.c          |   3 +-
 tools/testing/selftests/ublk/kublk.h          |  12 +-
 .../testing/selftests/ublk/test_generic_06.sh |  41 ++
 6 files changed, 425 insertions(+), 265 deletions(-)
 create mode 100644 tools/testing/selftests/ublk/fault_inject.c
 create mode 100755 tools/testing/selftests/ublk/test_generic_06.sh
Signature · 1 line
2.47.0