Linux block layer
 help / color / mirror / Atom feed
* [PATCH v3 0/6] nbd: eliminate queue freeze/unfreeze overhead in connection setup
@ 2026-07-13  6:56 Yang Erkun
  2026-07-13  6:56 ` [PATCH v3 1/6] nbd: simplify find_fallback() by removing redundant logic Yang Erkun
                   ` (6 more replies)
  0 siblings, 7 replies; 20+ messages in thread
From: Yang Erkun @ 2026-07-13  6:56 UTC (permalink / raw)
  To: josef, axboe, hch, yukuai
  Cc: yi.zhang, chengzhihao1, echo.chenlin, leo.lilong, wangkefeng.wang,
	yangerkun, linux-block, nbd

This series eliminates the blk_mq_freeze_queue()/unfreeze_queue()
overhead that currently occurs during nbd connection setup(nbd provide
ondemand and was using in AI sandbox e2b[1] to mount and attach rootfs).
Each freeze cycle will introduce a RCU grace which was significant
with multi-core system.

time nbd-client --name myexport --connections 96 127.0.0.1 1234

After this patchset:
real    0m0.090s
user    0m0.004s
sys     0m0.018s

Without this patchset:
real    0m2.195s
user    0m0.005s
sys     0m0.022s

v2->v3:
1. Stop using xarray, and protect it by rejecting late NBD_SET_SOCKS
2. Eliminate freeze in nbd_set_size when device setup
3. Add module parameter to eliminate freeze for pre-created device

v1->v2:
1. Rewrite cover letter
2. Eliminate freeze call from blk_mq_update_nr_hw_queues in
   nbd_start_device for netlink path


[1]. https://github.com/e2b-dev/e2b

Long Li (1):
  nbd: simplify find_fallback() by removing redundant logic

Yang Erkun (5):
  nbd: disallow NBD_SET_SOCK on an active device
  nbd: remove queue freeze in nbd_add_socket
  nbd: set nr_hw_queues at device creation to skip queue freeze
  nbd: skip queue freeze when setting size at device startup
  nbd: add nr_hw_queues module parameter for pre-created devices

 drivers/block/nbd.c | 119 ++++++++++++++++++++++++++++----------------
 1 file changed, 76 insertions(+), 43 deletions(-)

-- 
2.52.0


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2026-07-23  1:24 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-13  6:56 [PATCH v3 0/6] nbd: eliminate queue freeze/unfreeze overhead in connection setup Yang Erkun
2026-07-13  6:56 ` [PATCH v3 1/6] nbd: simplify find_fallback() by removing redundant logic Yang Erkun
2026-07-13  6:56 ` [PATCH v3 2/6] nbd: disallow NBD_SET_SOCK on an active device Yang Erkun
2026-07-22  3:03   ` yu kuai
2026-07-22  6:12     ` yangerkun
2026-07-13  6:56 ` [PATCH v3 3/6] nbd: remove queue freeze in nbd_add_socket Yang Erkun
2026-07-22  3:17   ` yu kuai
2026-07-22  6:35     ` yu kuai
2026-07-22  8:45       ` yangerkun
2026-07-22  9:20         ` yangerkun
2026-07-13  6:56 ` [PATCH v3 4/6] nbd: set nr_hw_queues at device creation to skip queue freeze Yang Erkun
2026-07-22  3:38   ` yu kuai
2026-07-23  1:09     ` yangerkun
2026-07-13  6:56 ` [PATCH v3 5/6] nbd: skip queue freeze when setting size at device startup Yang Erkun
2026-07-22  3:49   ` yu kuai
2026-07-23  1:22     ` yangerkun
2026-07-13  6:56 ` [PATCH v3 6/6] nbd: add nr_hw_queues module parameter for pre-created devices Yang Erkun
2026-07-22  3:53   ` yu kuai
2026-07-23  1:24     ` yangerkun
2026-07-21  8:41 ` [PATCH v3 0/6] nbd: eliminate queue freeze/unfreeze overhead in connection setup yangerkun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox