Skip to content

ublk: complete requests via blk_mq_complete_request() so rq_affinity applies

Yoav Cohen linux-block 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2ublk: complete requests via blk_mq_complete_request() so rq_affinity appliesdrivers/block/ublk_drv.c include/uapi/linux/ublk_cmd.h+59 -211 reply
2/2selftests: ublk: add test for rq_affinity completion redirectiontools/testing/selftests/ublk/Makefile tools/testing/selftests/ublk/kublk.c tools/testing/selftests/ublk/test_generic_18.sh+44 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] ublk: complete requests via blk_mq_complete_request() so rq_affinity applies

ublk ends successfully completed requests inline on the server thread, so rq_affinity never redirects completion work back to the submitting CPU the way it does for NVMe, SCSI, virtio-blk, loop, nbd and rnbd. Patch 1 fixes that and adds a feature flag so servers can detect support. Patch 2 adds a selftest for it.

With an SPDK-style polling user-space block server at queue depth 96, rq_affinity=2 gives 7-8% higher IOPS than today's always-inline completion by offloading a saturated server CPU; rq_affinity=0 keeps the old behavior for anyone who wants to opt out.

Yoav Cohen (2):
ublk: complete requests via blk_mq_complete_request() so rq_affinity
applies
selftests: ublk: add test for rq_affinity completion redirection

 drivers/block/ublk_drv.c                        | 72 +++++++++++++++++--------
 include/uapi/linux/ublk_cmd.h                   |  8 +++
 tools/testing/selftests/ublk/Makefile           |  1 +
 tools/testing/selftests/ublk/kublk.c            |  1 +
 tools/testing/selftests/ublk/test_generic_18.sh | 42 +++++++++++++++
 5 files changed, 103 insertions(+), 21 deletions(-)
 create mode 100755 tools/testing/selftests/ublk/test_generic_18.sh

--
2.50.1 (Apple Git-155)