Skip to contentSkip to conversation

RDMA/rxe: Use a dedicated and robust workqueue for RXE tasks

PATCH New Zhu Yanjun 1 participant 1 message Mar 18

Subsystems (2)
lore
Share & tools
lore

Zhu Yanjun

author
#0 lore raw

PATCH v2 1/1 RDMA/rxe: Use a dedicated and robust workqueue for RXE tasks

Currently, the RXE driver uses the system-wide 'system_unbound_wq' for auxiliary tasks like ODP prefetching. This can lead to interference from other system services and lacks guaranteed forward progress under memory pressure.

Currently make all the tasks queue into the driver-specific 'rxe_wq'.

---
V1 -> V2: Remove WQ_MEM_RECLAIM

---
 drivers/infiniband/sw/rxe/rxe_odp.c  | 2 +-
 drivers/infiniband/sw/rxe/rxe_task.c | 7 +++++++
 drivers/infiniband/sw/rxe/rxe_task.h | 1 +
 3 files changed, 9 insertions(+), 1 deletion(-)
drivers/infiniband/sw/rxe/rxe_odp.c +1 -1
index bc11b1ec59ac..98092dcc1870 100644
@@ -545,7 +545,7 @@ static int rxe_ib_advise_mr_prefetch(struct ib_pd *ibpd,
 		work->frags[i].mr = mr;
 	}
 
-	queue_work(system_unbound_wq, &work->work);
+	rxe_queue_work(&work->work);
 
 	return 0;
 
drivers/infiniband/sw/rxe/rxe_task.c +7 -0
index f522820b950c..59e88d759255 100644
@@ -254,6 +254,13 @@ void rxe_sched_task(struct rxe_task *task)
 	spin_unlock_irqrestore(&task->lock, flags);
 }
 
+/* Helper to queue auxiliary tasks into rxe_wq.
+ */
+void rxe_queue_work(struct work_struct *work)
+{
+	queue_work(rxe_wq, work);
+}
+
 /* rxe_disable/enable_task are only called from
  * rxe_modify_qp in process context. Task is moved
  * to the drained state by do_task.
drivers/infiniband/sw/rxe/rxe_task.h +1 -0
index a8c9a77b6027..60c085cc11a7 100644
@@ -36,6 +36,7 @@ int rxe_alloc_wq(void);
 
 void rxe_destroy_wq(void);
 
+void rxe_queue_work(struct work_struct *work);
 /*
  * init rxe_task structure
  *	qp  => parameter to pass to func
Signature · 1 line
2.53.0