]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: target: sbp: Replace use of system_unbound_wq with system_dfl_wq
authorMarco Crivellari <marco.crivellari@suse.com>
Tue, 4 Nov 2025 10:45:18 +0000 (11:45 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 13 Nov 2025 02:28:25 +0000 (21:28 -0500)
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>
drivers/target/sbp/sbp_target.c

index 3b89b5a70331f625c067dbcccf655a12347d9445..b8457477cee9eb14e0a3b77d32149ffd722de1f8 100644 (file)
@@ -730,7 +730,7 @@ static int tgt_agent_rw_orb_pointer(struct fw_card *card, int tcode, void *data,
                pr_debug("tgt_agent ORB_POINTER write: 0x%llx\n",
                                agent->orb_pointer);
 
-               queue_work(system_unbound_wq, &agent->work);
+               queue_work(system_dfl_wq, &agent->work);
 
                return RCODE_COMPLETE;
 
@@ -764,7 +764,7 @@ static int tgt_agent_rw_doorbell(struct fw_card *card, int tcode, void *data,
 
                pr_debug("tgt_agent DOORBELL\n");
 
-               queue_work(system_unbound_wq, &agent->work);
+               queue_work(system_dfl_wq, &agent->work);
 
                return RCODE_COMPLETE;
 
@@ -990,7 +990,7 @@ static void tgt_agent_fetch_work(struct work_struct *work)
 
                if (tgt_agent_check_active(agent) && !doorbell) {
                        INIT_WORK(&req->work, tgt_agent_process_work);
-                       queue_work(system_unbound_wq, &req->work);
+                       queue_work(system_dfl_wq, &req->work);
                } else {
                        /* don't process this request, just check next_ORB */
                        sbp_free_request(req);
@@ -1618,7 +1618,7 @@ static void sbp_mgt_agent_rw(struct fw_card *card,
                agent->orb_offset = sbp2_pointer_to_addr(ptr);
                agent->request = req;
 
-               queue_work(system_unbound_wq, &agent->work);
+               queue_work(system_dfl_wq, &agent->work);
                rcode = RCODE_COMPLETE;
        } else if (tcode == TCODE_READ_BLOCK_REQUEST) {
                addr_to_sbp2_pointer(agent->orb_offset, ptr);