linux/drivers/target
Marco Crivellari 2e2e559390 scsi: target: 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/20251107154008.304127-1-marco.crivellari@suse.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-11-12 21:28:27 -05:00
..
iscsi scsi: target: iscsi: fix typos and formatting in lio_target messages 2025-09-15 21:54:09 -04:00
loopback scsi: target: tcm_loop: Fix wrong abort tag 2025-03-17 22:04:21 -04:00
sbp scsi: target: sbp: Replace use of system_unbound_wq with system_dfl_wq 2025-11-12 21:28:25 -05:00
tcm_fc scsi: target: Add WQ_PERCPU to alloc_workqueue() users 2025-11-12 21:28:27 -05:00
tcm_remote scsi: target: Add virtual remote target 2023-03-16 23:36:37 -04:00
Kconfig scsi: target: Add virtual remote target 2023-03-16 23:36:37 -04:00
Makefile scsi: target: Add virtual remote target 2023-03-16 23:36:37 -04:00
target_core_alua.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
target_core_alua.h
target_core_configfs.c scsi: target: target_core_configfs: Add length check to avoid buffer overflow 2025-09-29 07:49:12 -04:00
target_core_device.c scsi: target: Move delayed/ordered tracking to per CPU 2025-04-28 21:47:55 -04:00
target_core_fabric_configfs.c scsi: target: Export fabric driver direct submit settings 2023-10-13 15:53:58 -04:00
target_core_fabric_lib.c scsi: target: core: Generate correct identifiers for PR OUT transport IDs 2025-07-24 21:57:00 -04:00
target_core_file.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
target_core_file.h
target_core_hba.c
target_core_iblock.c scsi: target: iblock: Allow iblock devices to be shared 2025-07-24 21:39:01 -04:00
target_core_iblock.h scsi: target: iblock: Allow iblock devices to be shared 2025-07-24 21:39:01 -04:00
target_core_internal.h scsi: target: core: Generate correct identifiers for PR OUT transport IDs 2025-07-24 21:57:00 -04:00
target_core_pr.c SCSI misc on 20250806 2025-08-06 15:44:25 +03:00
target_core_pr.h
target_core_pscsi.c block: add a bio_init_inline helper 2025-09-09 07:31:59 -06:00
target_core_pscsi.h target: port block device access to file 2024-02-25 12:05:25 +01:00
target_core_rd.c scsi: target: Rename sbc_ops to exec_cmd_ops 2023-04-11 21:55:36 -04:00
target_core_rd.h
target_core_sbc.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
target_core_spc.c scsi: target: core: Constify struct target_opcode_descriptor 2025-05-20 22:11:03 -04:00
target_core_stat.c scsi: target: Move I/O path stats to per CPU 2025-04-28 21:47:55 -04:00
target_core_tmr.c scsi: target: Fix multiple LUN_RESET handling 2023-03-24 17:32:23 -04:00
target_core_tpg.c Merge patch series "target: TMF and recovery fixes" 2023-03-24 17:39:15 -04:00
target_core_transport.c scsi: target: Add WQ_PERCPU to alloc_workqueue() users 2025-11-12 21:28:27 -05:00
target_core_ua.c
target_core_ua.h
target_core_user.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
target_core_xcopy.c scsi: target: Add WQ_PERCPU to alloc_workqueue() users 2025-11-12 21:28:27 -05:00
target_core_xcopy.h