Skip to content

Commit 4d5957c

Browse files
jacob-kellerJeff Kirsher
authored and
Jeff Kirsher
committed
i40e: remove WQ_UNBOUND and the task limit of our workqueue
During certain events such as a CORER, multiple devices will run a work task to handle some cleanup. This can cause issues due to a single-threaded workqueue which can mean that a device doesn't cleanup in time. Prevent this by removing the single-threaded restriction on the module workqueue. This avoids the need to add more complex yielding logic in our service task routine. This is also similar to what other drivers such as fm10k do. Signed-off-by: Jacob Keller <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 7c9ae7f commit 4d5957c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12180,12 +12180,14 @@ static int __init i40e_init_module(void)
1218012180
i40e_driver_string, i40e_driver_version_str);
1218112181
pr_info("%s: %s\n", i40e_driver_name, i40e_copyright);
1218212182

12183-
/* we will see if single thread per module is enough for now,
12184-
* it can't be any worse than using the system workqueue which
12185-
* was already single threaded
12183+
/* There is no need to throttle the number of active tasks because
12184+
* each device limits its own task using a state bit for scheduling
12185+
* the service task, and the device tasks do not interfere with each
12186+
* other, so we don't set a max task limit. We must set WQ_MEM_RECLAIM
12187+
* since we need to be able to guarantee forward progress even under
12188+
* memory pressure.
1218612189
*/
12187-
i40e_wq = alloc_workqueue("%s", WQ_UNBOUND | WQ_MEM_RECLAIM, 1,
12188-
i40e_driver_name);
12190+
i40e_wq = alloc_workqueue("%s", WQ_MEM_RECLAIM, 0, i40e_driver_name);
1218912191
if (!i40e_wq) {
1219012192
pr_err("%s: Failed to create workqueue\n", i40e_driver_name);
1219112193
return -ENOMEM;

0 commit comments

Comments
 (0)