]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i40e: remove WQ_UNBOUND and the task limit of our workqueue
authorJacob Keller <jacob.e.keller@intel.com>
Tue, 20 Jun 2017 22:16:54 +0000 (15:16 -0700)
committerJack Vogel <jack.vogel@oracle.com>
Tue, 10 Oct 2017 21:15:24 +0000 (14:15 -0700)
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 <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Orabug: 26785018
(cherry picked from commit 4d5957cbdecdbb77d24c1465caadd801c07afa4a)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Reviewed-by: Kyle Fortin <kyle.fortin@oracle.com>
drivers/net/ethernet/intel/i40e/i40e_main.c

index 633500bdb52bc5024c5281f7f5414014a53972f8..b2d1157e0da42c41818259d2c887e0b3c9a1b0d9 100644 (file)
@@ -12096,12 +12096,14 @@ static int __init i40e_init_module(void)
                i40e_driver_string, i40e_driver_version_str);
        pr_info("%s: %s\n", i40e_driver_name, i40e_copyright);
 
-       /* we will see if single thread per module is enough for now,
-        * it can't be any worse than using the system workqueue which
-        * was already single threaded
+       /* There is no need to throttle the number of active tasks because
+        * each device limits its own task using a state bit for scheduling
+        * the service task, and the device tasks do not interfere with each
+        * other, so we don't set a max task limit. We must set WQ_MEM_RECLAIM
+        * since we need to be able to guarantee forward progress even under
+        * memory pressure.
         */
-       i40e_wq = alloc_workqueue("%s", WQ_UNBOUND | WQ_MEM_RECLAIM, 1,
-                                 i40e_driver_name);
+       i40e_wq = alloc_workqueue("%s", WQ_MEM_RECLAIM, 0, i40e_driver_name);
        if (!i40e_wq) {
                pr_err("%s: Failed to create workqueue\n", i40e_driver_name);
                return -ENOMEM;