iwlwifi: dvm: convert create_singlethread_workqueue() to alloc_workqueue()
PATCH 1/1 iwlwifi: dvm: convert create_singlethread_workqueue() to alloc_workqueue()
Use alloc_workqueue() to allocate the workqueue instead of create_singlethread_workqueue() since the latter is deprecated and is scheduled for removal.
There are work items doing related operations that shouldn't be swapped when queued in a certain order hence preserve the strict execution ordering of a single threaded (ST) workqueue by setting max_active to 1 and adding the WQ_UNBOUND flag.
In addition, there are work items dealing with temperature throttling (tt_work, ct_enter, ct_exit). Adding the WQ_HIGHPRI flag would place the work items in a high priority workqueue.
Lastly, guarantee forward progress for work items depended upon during memory reclaim by the addition of the WQ_MEM_RECLAIM flag.
--- drivers/net/wireless/intel/iwlwifi/dvm/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/dvm/main.c +2 -1
@@ -1071,7 +1071,8 @@ static void iwl_bg_restart(struct work_struct *data)static void iwl_setup_deferred_work (struct iwl_priv *priv) { - priv->workqueue =create_singlethread_workqueue (DRV_NAME ); + priv->workqueue =alloc_workqueue (DRV_NAME ,WQ_HIGHPRI |WQ_UNBOUND | +WQ_MEM_RECLAIM ,1 );INIT_WORK (&priv->restart, iwl_bg_restart);INIT_WORK (&priv->beacon_update, iwl_bg_beacon_update);
Signature · 1 line
1.9.1
Hello, Eva.
Quoted 9 lines · Eva Rachel Retuya
Use
alloc_workqueue()to allocate the workqueue instead ofcreate_singlethread_workqueue()since the latter is deprecated and is scheduled for removal.There are work items doing related operations that shouldn't be swapped when queued in a certain order hence preserve the strict execution ordering of a single threaded (ST) workqueue by setting
max_activeto 1 and adding theWQ_UNBOUNDflag.
Quoted 6 lines
In addition, there are work items dealing with temperature throttling (
tt_work,ct_enter,ct_exit). Adding theWQ_HIGHPRIflag would place the work items in a high priority workqueue.Lastly, guarantee forward progress for work items depended upon during memory reclaim by the addition of the
WQ_MEM_RECLAIMflag.
Hmmm, why? Wireless doesn't sit in memory reclaim path although one can argue that the temperature management shouldn't be blocked while memory is short.
Can you please change this part to a question and repost the patch with the driver maintainers cc'd?
Thanks!
Signature · 1 line
tejun