Skip to contentSkip to conversation

Drivers: hv: connection: Remove create_workqueue

PATCH In review Bhaktipriya Shridhar 2 participants 2 messages Jun 18, 2016 – Jun 20, 2016 Hyper-V/Azure core and drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Drivers: hv: connection: Remove create_workqueue

alloc_workqueue replaces deprecated create_workqueue().
A dedicated workqueue has been used since the workitem (viz &ctx->work, which maps to vmbus_onmessage_work), is engaged in normal device operation which involves invoking the handler for channel protocol messages. WQ_MEM_RECLAIM has been set to guarantee forward progress under memory pressure, which is a requirement in this case.
Since there are only a fixed number of work items, explicit concurrency limit is unnecessary here.

---
 drivers/hv/connection.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/hv/connection.c +2 -1
index fcf8a02..a292b85 100644
@@ -147,7 +147,8 @@ int vmbus_connect(void)
 
 	/* Initialize the vmbus connection */
 	vmbus_connection.conn_state = CONNECTING;
-	vmbus_connection.work_queue = create_workqueue("hv_vmbus_con");
+	vmbus_connection.work_queue = alloc_workqueue("hv_vmbus_con",
+						      WQ_MEM_RECLAIM, 0);
 	if (!vmbus_connection.work_queue) {
 		ret = -ENOMEM;
 		goto cleanup;

--
2.1.4

#1 lore raw

Hello,

Quoted 19 lines · Bhaktipriya Shridhar

alloc_workqueue replaces deprecated create_workqueue().
A dedicated workqueue has been used since the workitem (viz &ctx->work, which maps to vmbus_onmessage_work), is engaged in normal device operation which involves invoking the handler for channel protocol messages. WQ_MEM_RECLAIM has been set to guarantee forward progress under memory pressure, which is a requirement in this case.
Since there are only a fixed number of work items, explicit concurrency limit is unnecessary here.

---
 drivers/hv/connection.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/hv/connection.c +0 -0
index fcf8a02..a292b85 100644

drivers/hv/connection.c int vmbus_connect(void) · line 151

Quoted 6 lines
drivers/hv/connection.c +2 -1
@@ -147,7 +147,8 @@ int vmbus_connect(void)
 
 	/* Initialize the vmbus connection */
 	vmbus_connection.conn_state = CONNECTING;
-	vmbus_connection.work_queue = create_workqueue("hv_vmbus_con");
+	vmbus_connection.work_queue = alloc_workqueue("hv_vmbus_con",
+						      WQ_MEM_RECLAIM, 0);

This is part of a hypervisor, right? I'm not sure why this would need WQ_MEM_RECLAIM. It doesn't play any role during memory reclaim, right?

Thanks.

Signature · 1 line
tejun