Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: target: sbp: Replace use of system_unbound_wq with system_dfl_wq

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.

This patch continues the effort to refactor worqueue APIs, which has
begun with the change introducing new workqueues and a new
alloc_workqueue flag:

commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq")
commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag")

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

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/20251104104518.102130-1-marco.crivellari@suse.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Marco Crivellari and committed by
Martin K. Petersen
0ba2fc76 cd87aa2e

+4 -4
+4 -4
drivers/target/sbp/sbp_target.c
··· 730 730 pr_debug("tgt_agent ORB_POINTER write: 0x%llx\n", 731 731 agent->orb_pointer); 732 732 733 - queue_work(system_unbound_wq, &agent->work); 733 + queue_work(system_dfl_wq, &agent->work); 734 734 735 735 return RCODE_COMPLETE; 736 736 ··· 764 764 765 765 pr_debug("tgt_agent DOORBELL\n"); 766 766 767 - queue_work(system_unbound_wq, &agent->work); 767 + queue_work(system_dfl_wq, &agent->work); 768 768 769 769 return RCODE_COMPLETE; 770 770 ··· 990 990 991 991 if (tgt_agent_check_active(agent) && !doorbell) { 992 992 INIT_WORK(&req->work, tgt_agent_process_work); 993 - queue_work(system_unbound_wq, &req->work); 993 + queue_work(system_dfl_wq, &req->work); 994 994 } else { 995 995 /* don't process this request, just check next_ORB */ 996 996 sbp_free_request(req); ··· 1618 1618 agent->orb_offset = sbp2_pointer_to_addr(ptr); 1619 1619 agent->request = req; 1620 1620 1621 - queue_work(system_unbound_wq, &agent->work); 1621 + queue_work(system_dfl_wq, &agent->work); 1622 1622 rcode = RCODE_COMPLETE; 1623 1623 } else if (tcode == TCODE_READ_BLOCK_REQUEST) { 1624 1624 addr_to_sbp2_pointer(agent->orb_offset, ptr);