Skip to contentSkip to conversation

qlge: Replace create_singlethread_workqueue with alloc_ordered_workqueue

PATCH Superseded Amitoj Kaur Chawla 2 participants 2 messages Mar 15, 2016 – Mar 16, 2016 Network drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qlge: Replace create_singlethread_workqueue with alloc_ordered_workqueue

Replace deprecated create_singlethread_workqueue with alloc_ordered_workqueue.

Use alloc_ordered_workqueue for work like getting tx/rx frame sizes, resetting MPI processor,setting asic recovery bit as only one work item should be in queue/executing at any given time.

WQ_MEM_RECLAIM flag has been set to ensure execution context regardless of memory pressure since qdev->workqueue might be used in memory reclaim path.

---
 drivers/net/ethernet/qlogic/qlge/qlge_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/qlogic/qlge/qlge_main.c +1 -1
index 9979764..089a9cb 100644
@@ -4676,7 +4676,7 @@ static int ql_init_device(struct pci_dev *pdev, struct net_device *ndev,
 	/*
 	 * Set up the operating parameters.
 	 */
-	qdev->workqueue = create_singlethread_workqueue(ndev->name);
+	qdev->workqueue = alloc_ordered_workqueue(ndev->name, WQ_MEM_RECLAIM);
 	INIT_DELAYED_WORK(&qdev->asic_reset_work, ql_asic_reset_work);
 	INIT_DELAYED_WORK(&qdev->mpi_reset_work, ql_mpi_reset_work);
 	INIT_DELAYED_WORK(&qdev->mpi_work, ql_mpi_work);
Signature · 1 line
1.9.1
#1 lore raw

Hello,

Quoted 6 lines · Amitoj Kaur Chawla

Replace deprecated create_singlethread_workqueue with alloc_ordered_workqueue.

Use alloc_ordered_workqueue for work like getting tx/rx frame sizes, resetting MPI processor,setting asic recovery bit as only one work item should be in queue/executing at any given time.

It'd be nice to explain why that is the case. It's okay to be speculative and ask the maintainers - e.g. say "Because of XXX and YYY, the ordering seems necessary" and then in the section below "---" ask the maintainer whether the assumption is correct.

Quoted 3 lines

WQ_MEM_RECLAIM flag has been set to ensure execution context regardless of memory pressure since qdev->workqueue might be used in memory reclaim path.

Hmmm... why? Network devices don't usually sit in the memory reclaim path although there are nfs and storage-over-net cases. I don't think we have a clear rule here. I'll ask around, but for now, I think it'd be better to default to not set it.

Thanks.

Signature · 1 line
tejun