Skip to contentSkip to conversation

cxl/pci: replace use of system_wq with system_percpu_wq

PATCH Applied Marco Crivellari 4 participants 7 messages Oct 30, 2025 – Nov 4, 2025 CXL

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cxl/pci: replace use of system_wq with system_percpu_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 consistency cannot be addressed without refactoring the API.

system_wq should be the per-cpu workqueue, yet in this name nothing makes that clear, so replace system_wq with system_percpu_wq.

The old wq (system_wq) will be kept for a few release cycles.

---
 drivers/cxl/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cxl/pci.c +1 -1
index bd100ac31672..0be4e508affe 100644
@@ -136,7 +136,7 @@ static irqreturn_t cxl_pci_mbox_irq(int irq, void *id)
 	if (opcode == CXL_MBOX_OP_SANITIZE) {
 		mutex_lock(&cxl_mbox->mbox_mutex);
 		if (mds->security.sanitize_node)
-			mod_delayed_work(system_wq, &mds->security.poll_dwork, 0);
+			mod_delayed_work(system_percpu_wq, &mds->security.poll_dwork, 0);
 		mutex_unlock(&cxl_mbox->mbox_mutex);
 	} else {
 		/* short-circuit the wait in __cxl_pci_mbox_send_cmd() */
Signature · 1 line
2.51.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Marco Crivellari

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 consistency cannot be addressed without refactoring the API.

Quoted 7 lines

system_wq should be the per-cpu workqueue, yet in this name nothing makes that clear, so replace system_wq with system_percpu_wq.

The old wq (system_wq) will be kept for a few release cycles.

Quoted 16 lines
 drivers/cxl/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cxl/pci.c +1 -1
index bd100ac31672..0be4e508affe 100644
@@ -136,7 +136,7 @@ static irqreturn_t cxl_pci_mbox_irq(int irq, void *id)
 	if (opcode == CXL_MBOX_OP_SANITIZE) {
 		mutex_lock(&cxl_mbox->mbox_mutex);
 		if (mds->security.sanitize_node)
-			mod_delayed_work(system_wq, &mds->security.poll_dwork, 0);
+			mod_delayed_work(system_percpu_wq, &mds->security.poll_dwork, 0);
 		mutex_unlock(&cxl_mbox->mbox_mutex);
 	} else {
 		/* short-circuit the wait in __cxl_pci_mbox_send_cmd() */
Reviewed-by on v1 1/1
#2 lore raw
In reply to Marco Crivellari
Quoted 6 lines · Marco Crivellari

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.

Quoted 6 lines

This lack of consistency cannot be addressed without refactoring the API.

system_wq should be the per-cpu workqueue, yet in this name nothing makes that clear, so replace system_wq with system_percpu_wq.

The old wq (system_wq) will be kept for a few release cycles.

A reference to:

commit 128ea9f6ccfb6960293ae4212f4f97165e42222d

Author: Marco Crivellari <[email protected]>
Date:   Sat Jun 14 15:35:29 2025 +0200

workqueue: Add system_percpu_wq and system_dfl_wq

...

Would have been nice just to save reviewers time. Regardless.

[snip]

#3 lore raw
Quoted 7 lines · Ira Weiny

[...]
A reference to:

commit 128ea9f6ccfb6960293ae4212f4f97165e42222d

Author: Marco Crivellari <[email protected]>
Date:   Sat Jun 14 15:35:29 2025 +0200
Quoted 7 lines

workqueue: Add system_percpu_wq and system_dfl_wq

...

Would have been nice just to save reviewers time. Regardless.

Many thanks, and sorry for the trouble!

--

Marco Crivellari

L3 Support Engineer, Technology & Product

maintainer Acked-by on v1 1/1
#4 lore raw
In reply to Marco Crivellari
Quoted 8 lines · Marco Crivellari

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 consistency cannot be addressed without refactoring the API.

Quoted 7 lines

system_wq should be the per-cpu workqueue, yet in this name nothing makes that clear, so replace system_wq with system_percpu_wq.

The old wq (system_wq) will be kept for a few release cycles.

maintainer Applied
#5 lore raw
In reply to Marco Crivellari
Quoted 8 lines · Marco Crivellari

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 consistency cannot be addressed without refactoring the API.

Quoted 7 lines

system_wq should be the per-cpu workqueue, yet in this name nothing makes that clear, so replace system_wq with system_percpu_wq.

The old wq (system_wq) will be kept for a few release cycles.

Applied to cxl/next
952e9057e66c17a9718232664368ffdaca468f93

Quoted 17 lines
---
 drivers/cxl/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cxl/pci.c +1 -1
index bd100ac31672..0be4e508affe 100644
@@ -136,7 +136,7 @@ static irqreturn_t cxl_pci_mbox_irq(int irq, void *id)
 	if (opcode == CXL_MBOX_OP_SANITIZE) {
 		mutex_lock(&cxl_mbox->mbox_mutex);
 		if (mds->security.sanitize_node)
-			mod_delayed_work(system_wq, &mds->security.poll_dwork, 0);
+			mod_delayed_work(system_percpu_wq, &mds->security.poll_dwork, 0);
 		mutex_unlock(&cxl_mbox->mbox_mutex);
 	} else {
 		/* short-circuit the wait in __cxl_pci_mbox_send_cmd() */
#6 lore raw
Quoted 3 lines · Dave Jiang

[...]
Applied to cxl/next
952e9057e66c17a9718232664368ffdaca468f93

Many thanks Dave!

Signature · 3 lines
Marco Crivellari

L3 Support Engineer, Technology & Product