[PATCH] nvmet: make nvmet_wq unbound
Sagi Grimberg
sagi at grimberg.me
Sun May 5 03:39:51 PDT 2024
From: Sagi Grimberg <sagi.grimberg at vastdata.com>
When deleting many controllers one-by-one, it takes a very
long time as these work elements may serialize as they are
scheduled on the executing cpu instead of spreading. In general
nvmet_wq can definitely be used for long standing work elements
so its better to make it unbound regardless.
While we are at it, expose it via sysfs to allow cpumask
control of this workqueue if a user wants to modify it.
Signed-off-by: Sagi Grimberg <sagi.grimberg at vastdata.com>
---
drivers/nvme/target/core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
index e06013c5dace..5e948864ea89 100644
--- a/drivers/nvme/target/core.c
+++ b/drivers/nvme/target/core.c
@@ -1686,7 +1686,8 @@ static int __init nvmet_init(void)
if (!buffered_io_wq)
goto out_free_zbd_work_queue;
- nvmet_wq = alloc_workqueue("nvmet-wq", WQ_MEM_RECLAIM, 0);
+ nvmet_wq = alloc_workqueue("nvmet-wq",
+ WQ_MEM_RECLAIM | WQ_SYSFS | WQ_UNBOUND, 0);
if (!nvmet_wq)
goto out_free_buffered_work_queue;
--
2.40.1
More information about the Linux-nvme
mailing list