Skip to content

RFC nbd: allow parallel genetlink operations

Yang Erkun linux-block 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest5 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5nbd: validate the backend identifier under config_lockdrivers/block/nbd.c+16 -160 replies
2/5nbd: decrement nbd_total_devices when a device is removeddrivers/block/nbd.c+1 -00 replies
3/5nbd: publish devices atomicallydrivers/block/nbd.c+16 -10 replies
4/5nbd: hold config_lock while updating nr_hw_queuesdrivers/block/nbd.c+31 -130 replies
5/5nbd: allow genetlink operations to run in paralleldrivers/block/nbd.c+1 -00 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC PATCH 0/5] nbd: allow parallel genetlink operations

Each nbd doit only touches the state of one device; the only global state is nbd_index_idr, accessed briefly under nbd_index_mutex. genl_mutex nevertheless serializes the whole genetlink doit path, and nbd_disconnect_and_put() sleeps in flush_workqueue() while holding it, so one device's teardown blocks every other device. This series enables parallel_ops for nbd.

Patches 1, 2 and 4 fix bugs that are reachable without parallel_ops; patch 3 makes device publication and the status walk consistent for concurrent genl handlers. Patch 5 enables parallel_ops.

A minimal netlink client on an 8-vCPU KVM guest, 32 devices x 10 connect/disconnect cycles, median of 3 runs: 390 ms -> 25 ms. Connect-only and status do not change.

Yang Erkun (5):
nbd: validate the backend identifier under config_lock
nbd: decrement nbd_total_devices when a device is removed
nbd: publish devices atomically
nbd: hold config_lock while updating nr_hw_queues
nbd: allow genetlink operations to run in parallel

 drivers/block/nbd.c | 95 +++++++++++++++++++++++++++++++--------------
 1 file changed, 65 insertions(+), 30 deletions(-)
Signature · 1 line
2.52.0