nvme-tcp: Use WQ_PERCPU explicitly if wq_unbound is false.
PATCH 1/1 nvme-tcp: Use WQ_PERCPU explicitly if wq_unbound is false.
Since commit 21c05ca88a54 ("workqueue: Add warnings and ensure one among WQ_PERCPU or WQ_UNBOUND is present"), we must explicitly set WQ_PERCPU or WQ_UNBOUND when creating workqueue.
nvme_tcp_init_module() sets WQ_UNBOUND when the module param wq_unbound is set, but otherwise, WQ_PERCPU is missing, triggering the warning below:
workqueue: nvme_tcp_wq is using neither WQ_PERCPU or WQ_UNBOUND. Setting WQ_PERCPU.
WARNING: kernel/workqueue.c:5856 at __alloc_workqueue+0x1d02/0x2070 kernel/workqueue.c:5855, CPU#0: swapper/0/1
Let's set WQ_PERCPU if wq_unbound is false.
--- drivers/nvme/host/tcp.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/nvme/host/tcp.c +2 -0
@@ -3046,6 +3046,8 @@ static int __init nvme_tcp_init_module(void)if (wq_unbound) wq_flags |=WQ_UNBOUND ; +else + wq_flags |=WQ_PERCPU ; nvme_tcp_wq =alloc_workqueue ("nvme_tcp_wq" , wq_flags,0 );if (!nvme_tcp_wq)
Signature · 1 line
2.54.0.823.g6e5bcc1fc9-goog
Quoted 25 lines · Kuniyuki Iwashima
Since commit
21c05ca88a54("workqueue: Add warnings and ensure one amongWQ_PERCPUorWQ_UNBOUNDis present"), we must explicitly setWQ_PERCPUorWQ_UNBOUNDwhen creating workqueue.
nvme_tcp_init_module()setsWQ_UNBOUNDwhen the module paramwq_unboundis set, but otherwise,WQ_PERCPUis missing, triggering the warning below:workqueue:
nvme_tcp_wqis using neitherWQ_PERCPUorWQ_UNBOUND. SettingWQ_PERCPU.WARNING: kernel/workqueue.c:5856 at __alloc_workqueue+0x1d02/0x2070 kernel/workqueue.c:5855, CPU#0: swapper/0/1Let's set
WQ_PERCPUifwq_unboundis false.Reported-by [email protected]Signed-off-by Kuniyuki Iwashima <[email protected]>--- drivers/nvme/host/tcp.c | 2 ++ 1 file changed, 2 insertions(+)drivers/nvme/host/tcp.c +0
-0
drivers/nvme/host/tcp.c static int __init nvme_tcp_init_module(void) · line 3053
Quoted 8 lines
drivers/nvme/host/tcp.c +2
-0@@ -3046,6 +3046,8 @@ static int __init nvme_tcp_init_module(void)if (wq_unbound) wq_flags |=WQ_UNBOUND ; +else + wq_flags |=WQ_PERCPU ; nvme_tcp_wq =alloc_workqueue ("nvme_tcp_wq" , wq_flags,0 );if (!nvme_tcp_wq)
Worth looking at blktests results with this.
Looks good.
-ck
Looks ok. Although I would have much preferred we would not have done these stupid changes to the workqueue interface to start with :(
Quoted 13 lines · Kuniyuki Iwashima
Since commit
21c05ca88a54("workqueue: Add warnings and ensure one amongWQ_PERCPUorWQ_UNBOUNDis present"), we must explicitly setWQ_PERCPUorWQ_UNBOUNDwhen creating workqueue.
nvme_tcp_init_module()setsWQ_UNBOUNDwhen the module paramwq_unboundis set, but otherwise,WQ_PERCPUis missing, triggering the warning below:workqueue:
nvme_tcp_wqis using neitherWQ_PERCPUorWQ_UNBOUND. SettingWQ_PERCPU.
Quoted 8 lines
WARNING: kernel/workqueue.c:5856 at __alloc_workqueue+0x1d02/0x2070 kernel/workqueue.c:5855, CPU#0: swapper/0/1Let's set
WQ_PERCPUifwq_unboundis false.Reported-by [email protected]Signed-off-by Kuniyuki Iwashima <[email protected]>---
This issue is seen on IBM Power server also [1].
And tested this patch, and it fixes reported issue. Please add below tag.
[1]: https://lore.kernel.org/all/[email protected]/
Regards,
Venkat.
Quoted 20 lines
drivers/nvme/host/tcp.c| 2 ++1 file changed, 2 insertions(+)drivers/nvme/host/tcp.c +2
-0@@ -3046,6 +3046,8 @@ static int __init nvme_tcp_init_module(void)if (wq_unbound) wq_flags |=WQ_UNBOUND ; +else + wq_flags |=WQ_PERCPU ; nvme_tcp_wq =alloc_workqueue ("nvme_tcp_wq" , wq_flags,0 );if (!nvme_tcp_wq)Signature · 1 line
2.54.0.823.g6e5bcc1fc9-goog
Quoted 25 lines · Kuniyuki Iwashima
Since commit
21c05ca88a54("workqueue: Add warnings and ensure one amongWQ_PERCPUorWQ_UNBOUNDis present"), we must explicitly setWQ_PERCPUorWQ_UNBOUNDwhen creating workqueue.
nvme_tcp_init_module()setsWQ_UNBOUNDwhen the module paramwq_unboundis set, but otherwise,WQ_PERCPUis missing, triggering the warning below:workqueue:
nvme_tcp_wqis using neitherWQ_PERCPUorWQ_UNBOUND. SettingWQ_PERCPU.WARNING: kernel/workqueue.c:5856 at __alloc_workqueue+0x1d02/0x2070 kernel/workqueue.c:5855, CPU#0: swapper/0/1Let's set
WQ_PERCPUifwq_unboundis false.Reported-by [email protected]Signed-off-by Kuniyuki Iwashima <[email protected]>--- drivers/nvme/host/tcp.c | 2 ++ 1 file changed, 2 insertions(+)drivers/nvme/host/tcp.c +0
-0
drivers/nvme/host/tcp.c static int __init nvme_tcp_init_module(void) · line 3053
Quoted 8 lines
drivers/nvme/host/tcp.c +2
-0@@ -3046,6 +3046,8 @@ static int __init nvme_tcp_init_module(void)if (wq_unbound) wq_flags |=WQ_UNBOUND ; +else + wq_flags |=WQ_PERCPU ; nvme_tcp_wq =alloc_workqueue ("nvme_tcp_wq" , wq_flags,0 );if (!nvme_tcp_wq)
Looks good to me.
Quoted 3 lines · Kuniyuki Iwashima
Since commit
21c05ca88a54("workqueue: Add warnings and ensure one amongWQ_PERCPUorWQ_UNBOUNDis present"), we must explicitly setWQ_PERCPUorWQ_UNBOUNDwhen creating workqueue.
Thanks, applied to nvme-7.2.