linux-kernelorg-stable/drivers/usb/storage
Marco Crivellari 71f91b401c usb: uas: add WQ_PERCPU to alloc_workqueue users
Currently if a user enqueues 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 consistency 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 continues the effort to refactor workqueue APIs, which began with
the introduction of new workqueues and a new alloc_workqueue flag in:

commit 128ea9f6cc ("workqueue: Add system_percpu_wq and system_dfl_wq")
commit 930c2ea566 ("workqueue: Add new WQ_PERCPU flag")

This change adds a new WQ_PERCPU flag to explicitly request
alloc_workqueue() to be per-cpu when WQ_UNBOUND has not been specified.

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.

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

Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
Link: https://patch.msgid.link/20251107154236.306620-1-marco.crivellari@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-21 15:10:55 +01:00
..
Kconfig
Makefile
alauda.c usb: storage: alauda: Use const for card ID array 2025-03-03 10:24:41 +01:00
cypress_atacb.c
datafab.c usb: storage: datafab: Use const for constant arrays 2025-03-03 10:24:41 +01:00
debug.c scsi: usb: Rename the RESERVE and RELEASE constants 2025-02-12 22:20:55 -05:00
debug.h
ene_ub6250.c
freecom.c
initializers.c usb: storage: initializers: Use const for constant array 2025-03-03 10:24:41 +01:00
initializers.h
isd200.c
jumpshot.c usb: storage: jumpshot: Use const for constant arrays 2025-03-03 10:24:41 +01:00
karma.c
onetouch.c
option_ms.c
option_ms.h
protocol.c
protocol.h
realtek_cr.c usb: storage: realtek_cr: Simplify residue calculation in rts51x_bulk_transport() 2025-09-06 15:21:25 +02:00
scsiglue.c
scsiglue.h
sddr09.c usb: storage: sddr09: Use const for constant arrays 2025-03-03 10:24:41 +01:00
sddr55.c usb: storage: sddr55: Use const for constant arrays 2025-03-03 10:24:41 +01:00
shuttle_usbat.c usb: storage: shuttle_usbat: Use const for constant array 2025-03-03 10:24:41 +01:00
sierra_ms.c
sierra_ms.h
transport.c usb: storage: transport: Use const for constant array 2025-03-03 10:24:41 +01:00
transport.h
uas-detect.h
uas.c usb: uas: add WQ_PERCPU to alloc_workqueue users 2025-11-21 15:10:55 +01:00
unusual_alauda.h
unusual_cypress.h
unusual_datafab.h
unusual_devs.h USB: storage: Ignore driver CD mode for Realtek multi-mode Wi-Fi dongles 2025-08-17 12:13:36 +02:00
unusual_ene_ub6250.h
unusual_freecom.h
unusual_isd200.h
unusual_jumpshot.h
unusual_karma.h
unusual_onetouch.h
unusual_realtek.h
unusual_sddr09.h
unusual_sddr55.h
unusual_uas.h usb: storage: Ignore UAS driver for SanDisk 3.2 Gen2 storage device 2025-05-21 13:09:45 +02:00
unusual_usbat.h
usb.c usb-storage: reject probe of device one non-DMA HCDs when using highmem 2025-05-05 13:22:39 -06:00
usb.h
usual-tables.c