Skip to content

Commit c74649b

Browse files
guixinliu1995keithbusch
authored andcommitted
nvmet: make nvmet_wq visible in sysfs
In some complex scenarios, we deploy multiple tasks on a single machine (hybrid deployment), such as Docker containers for function computation (background processing), real-time tasks, monitoring, event handling, and management, along with an NVMe target server. Each of these components is restricted to its own CPU cores to prevent mutual interference and ensure strict isolation. To achieve this level of isolation for nvmet_wq we need to  use sysfs tunables such as cpumask that are currently not accessible. Add WQ_SYSFS flag to alloc_workqueue() when creating nvmet_wq so workqueue tunables are exported in the userspace via sysfs. with this patch :- nvme (nvme-6.13) # ls /sys/devices/virtual/workqueue/nvmet-wq/ affinity_scope  affinity_strict  cpumask  max_active  nice per_cpu power  subsystem  uevent Signed-off-by: Guixin Liu <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent 63a5c7a commit c74649b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/nvme/target/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1717,7 +1717,7 @@ static int __init nvmet_init(void)
17171717
goto out_free_zbd_work_queue;
17181718

17191719
nvmet_wq = alloc_workqueue("nvmet-wq",
1720-
WQ_MEM_RECLAIM | WQ_UNBOUND, 0);
1720+
WQ_MEM_RECLAIM | WQ_UNBOUND | WQ_SYSFS, 0);
17211721
if (!nvmet_wq)
17221722
goto out_free_buffered_work_queue;
17231723

0 commit comments

Comments
 (0)