Skip to content

Commit 8757fd9

Browse files
q2venkeithbusch
authored andcommitted
nvme-tcp: Use WQ_PERCPU explicitly if wq_unbound is false.
Since commit 21c05ca ("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. Reported-by: syzbot+d078cba4418e65f61984@syzkaller.appspotmail.com Closes: https://lore.kernel.org/all/6a1a9a86.323e8352.141b09.0001.GAE@google.com/ Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com> Reviewed-by: Nilay Shroff <nilay@linux.ibm.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com> Signed-off-by: Keith Busch <kbusch@kernel.org>
1 parent 53cd102 commit 8757fd9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/nvme/host/tcp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3053,6 +3053,8 @@ static int __init nvme_tcp_init_module(void)
30533053

30543054
if (wq_unbound)
30553055
wq_flags |= WQ_UNBOUND;
3056+
else
3057+
wq_flags |= WQ_PERCPU;
30563058

30573059
nvme_tcp_wq = alloc_workqueue("nvme_tcp_wq", wq_flags, 0);
30583060
if (!nvme_tcp_wq)

0 commit comments

Comments
 (0)