hulk inclusion category: feature bugzilla: https://atomgit.com/openeuler/kernel/issues/9153 ---------------------------------------- The queue freeze was originally needed to prevent concurrent requests from accessing config->socks while the backing array was being reallocated. Since config->socks is now an xarray, insertions are safe under RCU without freezing the queue. This significantly reduces connection setup time when using a large number of connections (-C 256): before: real 4.510s after: real 0.263s Signed-off-by: Long Li <leo.lilong@huawei.com> --- drivers/block/nbd.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 198655b6f756..f9b51b09730a 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -1181,12 +1181,6 @@ static int nbd_add_socket(struct nbd_device *nbd, unsigned long arg, if (!sock) return err; - /* - * We need to make sure we don't get any errant requests while we're - * reallocating the ->socks array. - */ - blk_mq_freeze_queue(nbd->disk->queue); - if (!netlink && !nbd->task_setup && !test_bit(NBD_RT_BOUND, &config->runtime_flags)) nbd->task_setup = current; @@ -1222,12 +1216,10 @@ static int nbd_add_socket(struct nbd_device *nbd, unsigned long arg, config->num_connections++; atomic_inc(&config->live_connections); - blk_mq_unfreeze_queue(nbd->disk->queue); return 0; put_socket: - blk_mq_unfreeze_queue(nbd->disk->queue); sockfd_put(sock); return err; } -- 2.52.0