]> www.infradead.org Git - users/hch/misc.git/commitdiff
net: replace use of system_unbound_wq with system_dfl_wq
authorMarco Crivellari <marco.crivellari@suse.com>
Thu, 18 Sep 2025 14:24:25 +0000 (16:24 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 23 Sep 2025 00:40:30 +0000 (17:40 -0700)
Currently if a user enqueue a work item using schedule_delayed_work() the
used wq is "system_wq" (per-cpu wq) while queue_delayed_work() use
WORK_CPU_UNBOUND (used when a cpu is not specified). The same applies to
schedule_work() that is using system_wq and queue_work(), that makes use
again of WORK_CPU_UNBOUND.

This lack of consistentcy cannot be addressed without refactoring the API.

system_unbound_wq should be the default workqueue so as not to enforce
locality constraints for random work whenever it's not required.

Adding system_dfl_wq to encourage its use when unbound work should be used.

The old system_unbound_wq will be kept for a few release cycles.

Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
Link: https://patch.msgid.link/20250918142427.309519-2-marco.crivellari@suse.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/macvlan.c
drivers/net/netdevsim/dev.c
net/core/link_watch.c
net/unix/garbage.c

index 4df991e494bd0c2607b13f04b00e6cde8998e724..7966545512cfeab3914374675bafa3847e5d7ae1 100644 (file)
@@ -369,7 +369,7 @@ static void macvlan_broadcast_enqueue(struct macvlan_port *port,
        }
        spin_unlock(&port->bc_queue.lock);
 
-       queue_work(system_unbound_wq, &port->bc_work);
+       queue_work(system_dfl_wq, &port->bc_work);
 
        if (err)
                goto free_nskb;
index 2672d071b325efd71a659d600c9f9dda4346fe81..95f66c1f59db88ceafbf656b56081664168e5260 100644 (file)
@@ -851,7 +851,7 @@ static void nsim_dev_trap_report_work(struct work_struct *work)
        nsim_dev = nsim_trap_data->nsim_dev;
 
        if (!devl_trylock(priv_to_devlink(nsim_dev))) {
-               queue_delayed_work(system_unbound_wq,
+               queue_delayed_work(system_dfl_wq,
                                   &nsim_dev->trap_data->trap_report_dw, 1);
                return;
        }
@@ -867,7 +867,7 @@ static void nsim_dev_trap_report_work(struct work_struct *work)
                cond_resched();
        }
        devl_unlock(priv_to_devlink(nsim_dev));
-       queue_delayed_work(system_unbound_wq,
+       queue_delayed_work(system_dfl_wq,
                           &nsim_dev->trap_data->trap_report_dw,
                           msecs_to_jiffies(NSIM_TRAP_REPORT_INTERVAL_MS));
 }
@@ -924,7 +924,7 @@ static int nsim_dev_traps_init(struct devlink *devlink)
 
        INIT_DELAYED_WORK(&nsim_dev->trap_data->trap_report_dw,
                          nsim_dev_trap_report_work);
-       queue_delayed_work(system_unbound_wq,
+       queue_delayed_work(system_dfl_wq,
                           &nsim_dev->trap_data->trap_report_dw,
                           msecs_to_jiffies(NSIM_TRAP_REPORT_INTERVAL_MS));
 
index 864f3bbc3a4c50c1dfbebc5114b39609cc99e238..212cde35affa7bf1b3f84c902462b3f0864d0291 100644 (file)
@@ -157,9 +157,9 @@ static void linkwatch_schedule_work(int urgent)
         * override the existing timer.
         */
        if (test_bit(LW_URGENT, &linkwatch_flags))
-               mod_delayed_work(system_unbound_wq, &linkwatch_work, 0);
+               mod_delayed_work(system_dfl_wq, &linkwatch_work, 0);
        else
-               queue_delayed_work(system_unbound_wq, &linkwatch_work, delay);
+               queue_delayed_work(system_dfl_wq, &linkwatch_work, delay);
 }
 
 
index 01e2b9452c75b4dabf9e116a9947452c07b72d29..684ab03137b6c629f355e6ee0b9a6309827d7e08 100644 (file)
@@ -592,7 +592,7 @@ static DECLARE_WORK(unix_gc_work, __unix_gc);
 void unix_gc(void)
 {
        WRITE_ONCE(gc_in_progress, true);
-       queue_work(system_unbound_wq, &unix_gc_work);
+       queue_work(system_dfl_wq, &unix_gc_work);
 }
 
 #define UNIX_INFLIGHT_TRIGGER_GC 16000