Skip to content

Commit e8e1a4c

Browse files
DispatchCodekeithbusch
authored andcommitted
nvme: add WQ_PERCPU to alloc_workqueue users
This continues the effort to refactor workqueue APIs, which began with the introduction of new workqueues and a new alloc_workqueue flag in: commit 128ea9f ("workqueue: Add system_percpu_wq and system_dfl_wq") commit 930c2ea ("workqueue: Add new WQ_PERCPU flag") The refactoring is going to alter the default behavior of alloc_workqueue() to be unbound by default. With the introduction of the WQ_PERCPU flag (equivalent to !WQ_UNBOUND), any alloc_workqueue() caller that doesn’t explicitly specify WQ_UNBOUND must now use WQ_PERCPU. For more details see the Link tag below. In order to keep alloc_workqueue() behavior identical, explicitly request WQ_PERCPU. Link: https://lore.kernel.org/all/[email protected]/ Suggested-by: Tejun Heo <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Marco Crivellari <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent 12f5fb5 commit e8e1a4c

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

drivers/nvme/target/core.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1942,12 +1942,13 @@ static int __init nvmet_init(void)
19421942
if (!nvmet_bvec_cache)
19431943
return -ENOMEM;
19441944

1945-
zbd_wq = alloc_workqueue("nvmet-zbd-wq", WQ_MEM_RECLAIM, 0);
1945+
zbd_wq = alloc_workqueue("nvmet-zbd-wq", WQ_MEM_RECLAIM | WQ_PERCPU,
1946+
0);
19461947
if (!zbd_wq)
19471948
goto out_destroy_bvec_cache;
19481949

19491950
buffered_io_wq = alloc_workqueue("nvmet-buffered-io-wq",
1950-
WQ_MEM_RECLAIM, 0);
1951+
WQ_MEM_RECLAIM | WQ_PERCPU, 0);
19511952
if (!buffered_io_wq)
19521953
goto out_free_zbd_work_queue;
19531954

drivers/nvme/target/tcp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2225,7 +2225,7 @@ static int __init nvmet_tcp_init(void)
22252225
int ret;
22262226

22272227
nvmet_tcp_wq = alloc_workqueue("nvmet_tcp_wq",
2228-
WQ_MEM_RECLAIM | WQ_HIGHPRI, 0);
2228+
WQ_MEM_RECLAIM | WQ_HIGHPRI | WQ_PERCPU, 0);
22292229
if (!nvmet_tcp_wq)
22302230
return -ENOMEM;
22312231

0 commit comments

Comments
 (0)