Skip to contentSkip to conversation

rsxx: Remove deprecated create_singlethread_workqueue

PATCH In review Bhaktipriya Shridhar 2 participants 2 messages Aug 30, 2016 – Aug 31, 2016 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rsxx: Remove deprecated create_singlethread_workqueue

The workqueue "creg_wq" queues a single work item viz &card->creg_ctrl.done_work and hence it doesn't require execution ordering. Hence, alloc_workqueue has been used to replace the deprecated create_singlethread_workqueue instance.

The workqueue "event_wq" queues a single work item viz &card->event_work and hence it doesn't require execution ordering. Hence, alloc_workqueue has been used to replace the deprecated create_singlethread_workqueue instance.

The WQ_MEM_RECLAIM flag has been set in both cases to ensure forward progress under memory pressure.

Since there are a fixed number of work items, explicit concurrency limit is unnecessary here.

---
 drivers/block/rsxx/core.c  | 3 ++-
 drivers/block/rsxx/cregs.c | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/block/rsxx/core.c +2 -1
index 34997df..d46cab9 100644
@@ -887,7 +887,8 @@ static int rsxx_pci_probe(struct pci_dev *dev,
 	}
 
 	/************* Setup Card Event Handler *************/
-	card->event_wq = create_singlethread_workqueue(DRIVER_NAME"_event");
+	card->event_wq = alloc_workqueue(DRIVER_NAME "_event", WQ_MEM_RECLAIM,
+					 0);
 	if (!card->event_wq) {
 		dev_err(CARD_TO_DEV(card), "Failed card event setup.\n");
 		goto failed_event_handler;
drivers/block/rsxx/cregs.c +2 -2
index 926dce9..4f5a2e8 100644
@@ -736,8 +736,8 @@ int rsxx_creg_setup(struct rsxx_cardinfo *card)
 {
 	card->creg_ctrl.active_cmd = NULL;
 
-	card->creg_ctrl.creg_wq =
-			create_singlethread_workqueue(DRIVER_NAME"_creg");
+	card->creg_ctrl.creg_wq = alloc_workqueue(DRIVER_NAME "_creg",
+						  WQ_MEM_RECLAIM, 0);
 	if (!card->creg_ctrl.creg_wq)
 		return -ENOMEM;
 

--
2.1.4

Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Bhaktipriya Shridhar

The workqueue "creg_wq" queues a single work item viz &card->creg_ctrl.done_work and hence it doesn't require execution ordering. Hence, alloc_workqueue has been used to replace the deprecated create_singlethread_workqueue instance.

The workqueue "event_wq" queues a single work item viz &card->event_work and hence it doesn't require execution ordering. Hence, alloc_workqueue has been used to replace the deprecated create_singlethread_workqueue instance.

Quoted 7 lines

The WQ_MEM_RECLAIM flag has been set in both cases to ensure forward progress under memory pressure.

Since there are a fixed number of work items, explicit concurrency limit is unnecessary here.

Thanks.

Signature · 1 line
tejun