Linux block layer
 help / color / mirror / Atom feed
From: Yang Erkun <yangerkun@huawei.com>
To: axboe@kernel.dk, josef@toxicpanda.com, xiubli@redhat.com,
	prasanna.kalever@redhat.com, ming.lei@redhat.com, yukuai@fygo.io,
	nilay@linux.ibm.com
Cc: linux-block@vger.kernel.org, nbd@other.debian.org,
	yangerkun@huawei.com, wangkefeng.wang@huawei.com,
	leijitang@huawei.com, yi.zhang@huawei.com,
	chengzhihao1@huawei.com, houtao1@huawei.com, wozizhi@huawei.com
Subject: [RFC PATCH 0/5] nbd: allow parallel genetlink operations
Date: Sat,  7 Nov 2026 14:46:24 +0800	[thread overview]
Message-ID: <20261107064629.4093489-1-yangerkun@huawei.com> (raw)

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(-)

-- 
2.52.0


             reply	other threads:[~2026-11-07  6:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-07  6:46 Yang Erkun [this message]
2026-11-07  6:46 ` [RFC PATCH 1/5] nbd: validate the backend identifier under config_lock Yang Erkun
2026-11-07  6:46 ` [RFC PATCH 2/5] nbd: decrement nbd_total_devices when a device is removed Yang Erkun
2026-11-07  6:46 ` [RFC PATCH 3/5] nbd: publish devices atomically Yang Erkun
2026-11-07  6:46 ` [RFC PATCH 4/5] nbd: hold config_lock while updating nr_hw_queues Yang Erkun
2026-11-07  6:46 ` [RFC PATCH 5/5] nbd: allow genetlink operations to run in parallel Yang Erkun
2026-11-17  4:36 ` [RFC PATCH 0/5] nbd: allow parallel genetlink operations yangerkun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261107064629.4093489-1-yangerkun@huawei.com \
    --to=yangerkun@huawei.com \
    --cc=axboe@kernel.dk \
    --cc=chengzhihao1@huawei.com \
    --cc=houtao1@huawei.com \
    --cc=josef@toxicpanda.com \
    --cc=leijitang@huawei.com \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=nbd@other.debian.org \
    --cc=nilay@linux.ibm.com \
    --cc=prasanna.kalever@redhat.com \
    --cc=wangkefeng.wang@huawei.com \
    --cc=wozizhi@huawei.com \
    --cc=xiubli@redhat.com \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai@fygo.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox