Blob Blame History Raw
From: Daniel Wagner <dwagner@suse.de>
Date: Wed, 26 May 2021 13:34:22 +0200
Subject: RDMA/core: create ib_cm with WQ_MEM_RECLAIM flag
Patch-mainline: Never, no fix yet availabe upstream revert offending change
References: bsc#1183346

While running NVMe/oF wire unplug tests, we hit this warning in
kernel/workqueue.c:check_flush_dependency():

WARN_ONCE(worker && ((worker->current_pwq->wq->flags &
		      (WQ_MEM_RECLAIM | __WQ_LEGACY)) == WQ_MEM_RECLAIM),
	  "workqueue: WQ_MEM_RECLAIM %s:%pf is flushing !WQ_MEM_RECLAIM %s:%pf",
	  worker->current_pwq->wq->name, worker->current_func,
	  target_wq->name, target_func);

Set WQ_MEM_RECLAIM on the ib_cm workqueue.

This is to silence the warning and not fixing the problem at
all. Upstream is aware of this problem but there is no fix yet. To
avoid a lot of support requests undo the offending commit.

Link: https://patchwork.kernel.org/project/linux-rdma/patch/5f5a1e4e90f3625cea57ffa79fc0e5bcb7efe09d.1548963371.git.swise@opengridcomputing.com/
Fixes: cb93e597779e ("cm: Don't allocate ib_cm workqueue with WQ_MEM_RECLAIM")
Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
 drivers/infiniband/core/cm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index b686fa2a918c..d302e4a3150e 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -4518,7 +4518,7 @@ static int __init ib_cm_init(void)
 		goto error1;
 	}
 
-	cm.wq = alloc_workqueue("ib_cm", 0, 1);
+	cm.wq = alloc_workqueue("ib_cm", WQ_MEM_RECLAIM, 1);
 	if (!cm.wq) {
 		ret = -ENOMEM;
 		goto error2;
-- 
2.29.2