Skip to content

Commit 4c4b199

Browse files
Mike Marciniszynjgunthorpe
authored andcommitted
IB/hfi1: Fix WQ_MEM_RECLAIM warning
The work_item cancels that occur when a QP is destroyed can elicit the following trace: workqueue: WQ_MEM_RECLAIM ipoib_wq:ipoib_cm_tx_reap [ib_ipoib] is flushing !WQ_MEM_RECLAIM hfi0_0:_hfi1_do_send [hfi1] WARNING: CPU: 7 PID: 1403 at kernel/workqueue.c:2486 check_flush_dependency+0xb1/0x100 Call Trace: __flush_work.isra.29+0x8c/0x1a0 ? __switch_to_asm+0x40/0x70 __cancel_work_timer+0x103/0x190 ? schedule+0x32/0x80 iowait_cancel_work+0x15/0x30 [hfi1] rvt_reset_qp+0x1f8/0x3e0 [rdmavt] rvt_destroy_qp+0x65/0x1f0 [rdmavt] ? _cond_resched+0x15/0x30 ib_destroy_qp+0xe9/0x230 [ib_core] ipoib_cm_tx_reap+0x21c/0x560 [ib_ipoib] process_one_work+0x171/0x370 worker_thread+0x49/0x3f0 kthread+0xf8/0x130 ? max_active_store+0x80/0x80 ? kthread_bind+0x10/0x10 ret_from_fork+0x35/0x40 Since QP destruction frees memory, hfi1_wq should have the WQ_MEM_RECLAIM. The hfi1_wq does not allocate memory with GFP_KERNEL or otherwise become entangled with memory reclaim, so this flag is appropriate. Fixes: 0a226ed ("staging/rdma/hfi1: Use parallel workqueue for SDMA engines") Reviewed-by: Michael J. Ruhl <[email protected]> Signed-off-by: Mike Marciniszyn <[email protected]> Signed-off-by: Dennis Dalessandro <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 10bf13c commit 4c4b199

File tree

1 file changed

+2
-1
lines changed
  • drivers/infiniband/hw/hfi1

1 file changed

+2
-1
lines changed

drivers/infiniband/hw/hfi1/init.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,8 @@ static int create_workqueues(struct hfi1_devdata *dd)
805805
ppd->hfi1_wq =
806806
alloc_workqueue(
807807
"hfi%d_%d",
808-
WQ_SYSFS | WQ_HIGHPRI | WQ_CPU_INTENSIVE,
808+
WQ_SYSFS | WQ_HIGHPRI | WQ_CPU_INTENSIVE |
809+
WQ_MEM_RECLAIM,
809810
HFI1_MAX_ACTIVE_WORKQUEUE_ENTRIES,
810811
dd->unit, pidx);
811812
if (!ppd->hfi1_wq)

0 commit comments

Comments
 (0)