Skip to contentSkip to conversation

mlxsw: core: Remove deprecated create_workqueue

PATCH Applied Bhaktipriya Shridhar 4 participants 4 messages Jun 7, 2016 – Jun 10, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mlxsw: core: Remove deprecated create_workqueue

alloc_workqueue replaces deprecated create_workqueue().

A dedicated workqueue has been used since the workqueue mlxsw_wq is used for FDB notif. processing with workitems that are involved in normal device operation && because it's a network device which can be depended upon during memory reclaim.

Workitems &trans->timeout_dw and &mlxsw_sp->fdb_notify.dw, map to mlxsw_sp_fdb_notify_work (processes FDB notifications from the underlying device and resolves the netdev to which the entry points to and notifies the bridge using the switchdev notifier) and mlxsw_emad_trans_timeout_work (provides async EMAD register access) respectively. They require forward progress under memory pressure and hence, WQ_MEM_RECLAIM has been set.

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

---
 drivers/net/ethernet/mellanox/mlxsw/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlxsw/core.c +1 -1
index b0a0b01..01ae548 100644
@@ -1736,7 +1736,7 @@ static int __init mlxsw_core_module_init(void)
 {
 	int err;
 
-	mlxsw_wq = create_workqueue(mlxsw_core_driver_name);
+	mlxsw_wq = alloc_workqueue(mlxsw_core_driver_name, WQ_MEM_RECLAIM, 0);
 	if (!mlxsw_wq)
 		return -ENOMEM;
 	mlxsw_core_dbg_root = debugfs_create_dir(mlxsw_core_driver_name, NULL);
Tested-by on v1 1/1
#1 lore raw
Quoted 7 lines · Tue, Jun 07, 2016 at 10:59:46PM IDT, [email protected] wrote:

alloc_workqueue replaces deprecated create_workqueue().

A dedicated workqueue has been used since the workqueue mlxsw_wq is used for FDB notif. processing with workitems that are involved in normal device operation && because it's a network device which can be depended upon during memory reclaim.

Quoted 6 lines

Workitems &trans->timeout_dw and &mlxsw_sp->fdb_notify.dw, map to mlxsw_sp_fdb_notify_work (processes FDB notifications from the underlying device and resolves the netdev to which the entry points to and notifies the bridge using the switchdev notifier) and mlxsw_emad_trans_timeout_work (provides async EMAD register access) respectively.

The ordering here is off - timeout_dw is for mlxsw_emad_trans_timeout_work() and fdb_notify.dw is for mlxsw_sp_fdb_notify_work(), but otherwise this seems fine to me.

Thanks!

Acked-by on v1 1/1
#2 lore raw
In reply to Bhaktipriya Shridhar
Quoted 15 lines · Tue, Jun 07, 2016 at 09:59:46PM CEST, [email protected] wrote:

alloc_workqueue replaces deprecated create_workqueue().

A dedicated workqueue has been used since the workqueue mlxsw_wq is used for FDB notif. processing with workitems that are involved in normal device operation && because it's a network device which can be depended upon during memory reclaim.

Workitems &trans->timeout_dw and &mlxsw_sp->fdb_notify.dw, map to mlxsw_sp_fdb_notify_work (processes FDB notifications from the underlying device and resolves the netdev to which the entry points to and notifies the bridge using the switchdev notifier) and mlxsw_emad_trans_timeout_work (provides async EMAD register access) respectively. They require forward progress under memory pressure and hence, WQ_MEM_RECLAIM has been set.

Quoted 4 lines

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

maintainer Applied
#3 lore raw
In reply to Bhaktipriya Shridhar

From: Bhaktipriya Shridhar <[email protected]>
Date: Wed, 8 Jun 2016 01:29:46 +0530

Quoted 15 lines

alloc_workqueue replaces deprecated create_workqueue().

A dedicated workqueue has been used since the workqueue mlxsw_wq is used for FDB notif. processing with workitems that are involved in normal device operation && because it's a network device which can be depended upon during memory reclaim.

Workitems &trans->timeout_dw and &mlxsw_sp->fdb_notify.dw, map to mlxsw_sp_fdb_notify_work (processes FDB notifications from the underlying device and resolves the netdev to which the entry points to and notifies the bridge using the switchdev notifier) and mlxsw_emad_trans_timeout_work (provides async EMAD register access) respectively. They require forward progress under memory pressure and hence, WQ_MEM_RECLAIM has been set.

Quoted 4 lines

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

Applied.