linux/drivers/net/wireguard
Marco Crivellari 27ce71e1ce net: WQ_PERCPU added to alloc_workqueue users
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.

alloc_workqueue() treats all queues as per-CPU by default, while unbound
workqueues must opt-in via WQ_UNBOUND.

This default is suboptimal: most workloads benefit from unbound queues,
allowing the scheduler to place worker threads where they’re needed and
reducing noise when CPUs are isolated.

This change adds a new WQ_PERCPU flag at the network subsystem, to explicitly
request the use of the per-CPU behavior. Both flags coexist for one release
cycle to allow callers to transition their calls.

Once migration is complete, WQ_UNBOUND can be removed and unbound will
become the implicit default.

With the introduction of the WQ_PERCPU flag (equivalent to !WQ_UNBOUND),
any alloc_workqueue() caller that doesn’t explicitly specify WQ_UNBOUND
must now use WQ_PERCPU.

All existing users have been updated accordingly.

Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
Link: https://patch.msgid.link/20250918142427.309519-4-marco.crivellari@suse.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-09-22 17:40:30 -07:00
..
selftest wireguard: allowedips: add WGALLOWEDIP_F_REMOVE_ME flag 2025-05-27 09:06:19 +02:00
allowedips.c wireguard: allowedips: add WGALLOWEDIP_F_REMOVE_ME flag 2025-05-27 09:06:19 +02:00
allowedips.h wireguard: allowedips: add WGALLOWEDIP_F_REMOVE_ME flag 2025-05-27 09:06:19 +02:00
cookie.c wireguard: global: add __nonstring annotations for unterminated strings 2025-05-27 09:06:19 +02:00
cookie.h
device.c net: WQ_PERCPU added to alloc_workqueue users 2025-09-22 17:40:30 -07:00
device.h
main.c genetlink: remove linux/genetlink.h 2024-04-01 21:44:34 -07:00
Makefile
messages.h
netlink.c wireguard: allowedips: add WGALLOWEDIP_F_REMOVE_ME flag 2025-05-27 09:06:19 +02:00
netlink.h
noise.c wireguard: global: add __nonstring annotations for unterminated strings 2025-05-27 09:06:19 +02:00
noise.h
peer.c net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
peer.h wireguard: peer: Replace sockaddr with sockaddr_inet 2025-07-25 15:29:58 -07:00
peerlookup.c
peerlookup.h
queueing.c wireguard: queueing: use saner cpu selection wrapping 2023-07-03 09:17:52 +01:00
queueing.h wireguard: queueing: always return valid online CPU in wg_cpumask_choose_online() 2025-09-11 18:52:21 -07:00
ratelimiter.c
ratelimiter.h
receive.c wireguard: receive: annotate data-race around receiving_counter.counter 2024-03-19 11:22:49 +01:00
send.c wireguard: send: annotate intentional data race in checking empty queue 2024-07-05 17:21:10 -07:00
socket.c net: ipv6: Add a flags argument to ip6tunnel_xmit(), udp_tunnel6_xmit_skb() 2025-06-17 18:18:45 -07:00
socket.h
timers.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
timers.h
version.h