* [PATCH 1/3] ath6kl: add WQ_PERCPU to alloc_workqueue users
2025-11-13 16:20 [PATCH 0/3] replace system_unbound_wq, add WQ_PERCPU to alloc_workqueue Marco Crivellari
@ 2025-11-13 16:20 ` Marco Crivellari
2025-11-13 16:20 ` [PATCH 2/3] cw1200: " Marco Crivellari
` (2 subsequent siblings)
3 siblings, 0 replies; 11+ messages in thread
From: Marco Crivellari @ 2025-11-13 16:20 UTC (permalink / raw)
To: linux-kernel, linux-wireless
Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
Sebastian Andrzej Siewior, Marco Crivellari, Michal Hocko,
Johannes Berg
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.
For more details see the Link tag below.
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 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq")
commit 930c2ea566af ("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://lore.kernel.org/all/20250221112003.1dSuoGyc@linutronix.de/
---
drivers/net/wireless/ath/ath6kl/usb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath6kl/usb.c b/drivers/net/wireless/ath/ath6kl/usb.c
index 38bb501fc553..bfb21725d779 100644
--- a/drivers/net/wireless/ath/ath6kl/usb.c
+++ b/drivers/net/wireless/ath/ath6kl/usb.c
@@ -637,7 +637,7 @@ static struct ath6kl_usb *ath6kl_usb_create(struct usb_interface *interface)
ar_usb = kzalloc(sizeof(struct ath6kl_usb), GFP_KERNEL);
if (ar_usb == NULL)
return NULL;
- ar_usb->wq = alloc_workqueue("ath6kl_wq", 0, 0);
+ ar_usb->wq = alloc_workqueue("ath6kl_wq", WQ_PERCPU, 0);
if (!ar_usb->wq) {
kfree(ar_usb);
return NULL;
--
2.51.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 2/3] cw1200: add WQ_PERCPU to alloc_workqueue users
2025-11-13 16:20 [PATCH 0/3] replace system_unbound_wq, add WQ_PERCPU to alloc_workqueue Marco Crivellari
2025-11-13 16:20 ` [PATCH 1/3] ath6kl: add WQ_PERCPU to alloc_workqueue users Marco Crivellari
@ 2025-11-13 16:20 ` Marco Crivellari
2025-11-13 16:20 ` [PATCH 3/3] wifi: replace use of system_unbound_wq with system_dfl_wq Marco Crivellari
2026-01-13 10:28 ` [PATCH 0/3] replace system_unbound_wq, add WQ_PERCPU to alloc_workqueue Marco Crivellari
3 siblings, 0 replies; 11+ messages in thread
From: Marco Crivellari @ 2025-11-13 16:20 UTC (permalink / raw)
To: linux-kernel, linux-wireless
Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
Sebastian Andrzej Siewior, Marco Crivellari, Michal Hocko,
Johannes Berg
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.
For more details see the Link tag below.
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 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq")
commit 930c2ea566af ("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://lore.kernel.org/all/20250221112003.1dSuoGyc@linutronix.de/
---
drivers/net/wireless/st/cw1200/bh.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/st/cw1200/bh.c b/drivers/net/wireless/st/cw1200/bh.c
index 3b4ded2ac801..bdf7132c5849 100644
--- a/drivers/net/wireless/st/cw1200/bh.c
+++ b/drivers/net/wireless/st/cw1200/bh.c
@@ -54,8 +54,9 @@ int cw1200_register_bh(struct cw1200_common *priv)
int err = 0;
/* Realtime workqueue */
priv->bh_workqueue = alloc_workqueue("cw1200_bh",
- WQ_MEM_RECLAIM | WQ_HIGHPRI
- | WQ_CPU_INTENSIVE, 1);
+ WQ_MEM_RECLAIM | WQ_HIGHPRI |
+ WQ_CPU_INTENSIVE | WQ_PERCPU,
+ 1);
if (!priv->bh_workqueue)
return -ENOMEM;
--
2.51.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 3/3] wifi: replace use of system_unbound_wq with system_dfl_wq
2025-11-13 16:20 [PATCH 0/3] replace system_unbound_wq, add WQ_PERCPU to alloc_workqueue Marco Crivellari
2025-11-13 16:20 ` [PATCH 1/3] ath6kl: add WQ_PERCPU to alloc_workqueue users Marco Crivellari
2025-11-13 16:20 ` [PATCH 2/3] cw1200: " Marco Crivellari
@ 2025-11-13 16:20 ` Marco Crivellari
2026-01-13 10:28 ` [PATCH 0/3] replace system_unbound_wq, add WQ_PERCPU to alloc_workqueue Marco Crivellari
3 siblings, 0 replies; 11+ messages in thread
From: Marco Crivellari @ 2025-11-13 16:20 UTC (permalink / raw)
To: linux-kernel, linux-wireless
Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
Sebastian Andrzej Siewior, Marco Crivellari, Michal Hocko,
Johannes Berg
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.
For more details see the Link tag below.
This continues the effort to refactor workqueue APIs, which began with
the introduction of new workqueues and a new alloc_workqueue flag in:
commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq")
commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag")
Switch to using system_dfl_wq because system_unbound_wq is going away as part of
a workqueue restructuring.
Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
Link: https://lore.kernel.org/all/20250221112003.1dSuoGyc@linutronix.de/
---
net/wireless/core.c | 4 ++--
net/wireless/sysfs.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 54a34d8d356e..01775d8f4406 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -428,7 +428,7 @@ static void cfg80211_wiphy_work(struct work_struct *work)
if (wk) {
list_del_init(&wk->entry);
if (!list_empty(&rdev->wiphy_work_list))
- queue_work(system_unbound_wq, work);
+ queue_work(system_dfl_wq, work);
spin_unlock_irq(&rdev->wiphy_work_lock);
trace_wiphy_work_run(&rdev->wiphy, wk);
@@ -1698,7 +1698,7 @@ void wiphy_work_queue(struct wiphy *wiphy, struct wiphy_work *work)
list_add_tail(&work->entry, &rdev->wiphy_work_list);
spin_unlock_irqrestore(&rdev->wiphy_work_lock, flags);
- queue_work(system_unbound_wq, &rdev->wiphy_work);
+ queue_work(system_dfl_wq, &rdev->wiphy_work);
}
EXPORT_SYMBOL_GPL(wiphy_work_queue);
diff --git a/net/wireless/sysfs.c b/net/wireless/sysfs.c
index 62f26618f674..8d142856e385 100644
--- a/net/wireless/sysfs.c
+++ b/net/wireless/sysfs.c
@@ -137,7 +137,7 @@ static int wiphy_resume(struct device *dev)
if (rdev->wiphy.registered && rdev->ops->resume)
ret = rdev_resume(rdev);
rdev->suspended = false;
- queue_work(system_unbound_wq, &rdev->wiphy_work);
+ queue_work(system_dfl_wq, &rdev->wiphy_work);
wiphy_unlock(&rdev->wiphy);
if (ret)
--
2.51.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH 0/3] replace system_unbound_wq, add WQ_PERCPU to alloc_workqueue
2025-11-13 16:20 [PATCH 0/3] replace system_unbound_wq, add WQ_PERCPU to alloc_workqueue Marco Crivellari
` (2 preceding siblings ...)
2025-11-13 16:20 ` [PATCH 3/3] wifi: replace use of system_unbound_wq with system_dfl_wq Marco Crivellari
@ 2026-01-13 10:28 ` Marco Crivellari
2026-01-13 11:05 ` Johannes Berg
3 siblings, 1 reply; 11+ messages in thread
From: Marco Crivellari @ 2026-01-13 10:28 UTC (permalink / raw)
To: linux-kernel, linux-wireless
Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
Sebastian Andrzej Siewior, Michal Hocko, Johannes Berg
On Thu, Nov 13, 2025 at 5:20 PM Marco Crivellari
<marco.crivellari@suse.com> wrote:
> [...]
> Marco Crivellari (3):
> ath6kl: add WQ_PERCPU to alloc_workqueue users
> cw1200: add WQ_PERCPU to alloc_workqueue users
> wifi: replace use of system_unbound_wq with system_dfl_wq
>
> drivers/net/wireless/ath/ath6kl/usb.c | 2 +-
> drivers/net/wireless/st/cw1200/bh.c | 5 +++--
> net/wireless/core.c | 4 ++--
> net/wireless/sysfs.c | 2 +-
> 4 files changed, 7 insertions(+), 6 deletions(-)
Gentle ping.
Thanks!
--
Marco Crivellari
L3 Support Engineer
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH 0/3] replace system_unbound_wq, add WQ_PERCPU to alloc_workqueue
2026-01-13 10:28 ` [PATCH 0/3] replace system_unbound_wq, add WQ_PERCPU to alloc_workqueue Marco Crivellari
@ 2026-01-13 11:05 ` Johannes Berg
2026-01-13 11:16 ` Marco Crivellari
0 siblings, 1 reply; 11+ messages in thread
From: Johannes Berg @ 2026-01-13 11:05 UTC (permalink / raw)
To: Marco Crivellari, linux-kernel, linux-wireless
Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
Sebastian Andrzej Siewior, Michal Hocko
On Tue, 2026-01-13 at 11:28 +0100, Marco Crivellari wrote:
> On Thu, Nov 13, 2025 at 5:20 PM Marco Crivellari
> <marco.crivellari@suse.com> wrote:
> > [...]
> > Marco Crivellari (3):
> > ath6kl: add WQ_PERCPU to alloc_workqueue users
> > cw1200: add WQ_PERCPU to alloc_workqueue users
> > wifi: replace use of system_unbound_wq with system_dfl_wq
> >
> > drivers/net/wireless/ath/ath6kl/usb.c | 2 +-
> > drivers/net/wireless/st/cw1200/bh.c | 5 +++--
> > net/wireless/core.c | 4 ++--
> > net/wireless/sysfs.c | 2 +-
> > 4 files changed, 7 insertions(+), 6 deletions(-)
>
> Gentle ping.
I have none of these pending now - if I didn't accept them then they're
lost. I did try to apply another similar one yesterday but it was
already there in a slightly different format, so maybe things have
gotten out of sync?
johannes
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 0/3] replace system_unbound_wq, add WQ_PERCPU to alloc_workqueue
2026-01-13 11:05 ` Johannes Berg
@ 2026-01-13 11:16 ` Marco Crivellari
2026-01-13 11:19 ` Johannes Berg
0 siblings, 1 reply; 11+ messages in thread
From: Marco Crivellari @ 2026-01-13 11:16 UTC (permalink / raw)
To: Johannes Berg
Cc: linux-kernel, linux-wireless, Tejun Heo, Lai Jiangshan,
Frederic Weisbecker, Sebastian Andrzej Siewior, Michal Hocko
On Tue, Jan 13, 2026 at 12:05 PM Johannes Berg
<johannes@sipsolutions.net> wrote:
> I have none of these pending now - if I didn't accept them then they're
> lost. I did try to apply another similar one yesterday but it was
> already there in a slightly different format, so maybe things have
> gotten out of sync?
>
> johannes
Hi Johannes,
That's likely.
I rebased now on v6.19-rc5 and I can only see in my branch:
"ath6kl: add WQ_PERCPU to alloc_workqueue users".
The others seem already applied.
Well, sorry for the noise.
Thank you!
--
Marco Crivellari
L3 Support Engineer
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 0/3] replace system_unbound_wq, add WQ_PERCPU to alloc_workqueue
2026-01-13 11:16 ` Marco Crivellari
@ 2026-01-13 11:19 ` Johannes Berg
2026-01-13 11:24 ` Marco Crivellari
0 siblings, 1 reply; 11+ messages in thread
From: Johannes Berg @ 2026-01-13 11:19 UTC (permalink / raw)
To: Marco Crivellari
Cc: linux-kernel, linux-wireless, Tejun Heo, Lai Jiangshan,
Frederic Weisbecker, Sebastian Andrzej Siewior, Michal Hocko
On Tue, 2026-01-13 at 12:16 +0100, Marco Crivellari wrote:
> On Tue, Jan 13, 2026 at 12:05 PM Johannes Berg
> <johannes@sipsolutions.net> wrote:
> > I have none of these pending now - if I didn't accept them then they're
> > lost. I did try to apply another similar one yesterday but it was
> > already there in a slightly different format, so maybe things have
> > gotten out of sync?
> >
> > johannes
>
> Hi Johannes,
>
> That's likely.
> I rebased now on v6.19-rc5 and I can only see in my branch:
> "ath6kl: add WQ_PERCPU to alloc_workqueue users".
>
> The others seem already applied.
>
> Well, sorry for the noise.
OK cool, no worries. FWIW I might have even more in wireless-next:
https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git/
If you want to see what's pending, we have it in patchwork for wireless:
https://patchwork.kernel.org/project/linux-wireless/list/
The ath6kl one seems to be pending still on Jeff:
https://patchwork.kernel.org/project/linux-wireless/patch/20251113162032.394804-2-marco.crivellari@suse.com/
johannes
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 0/3] replace system_unbound_wq, add WQ_PERCPU to alloc_workqueue
2026-01-13 11:19 ` Johannes Berg
@ 2026-01-13 11:24 ` Marco Crivellari
2026-01-14 0:42 ` Ping-Ke Shih
0 siblings, 1 reply; 11+ messages in thread
From: Marco Crivellari @ 2026-01-13 11:24 UTC (permalink / raw)
To: Johannes Berg
Cc: linux-kernel, linux-wireless, Tejun Heo, Lai Jiangshan,
Frederic Weisbecker, Sebastian Andrzej Siewior, Michal Hocko
On Tue, Jan 13, 2026 at 12:19 PM Johannes Berg
<johannes@sipsolutions.net> wrote:
> OK cool, no worries. FWIW I might have even more in wireless-next:
> https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git/
>
> If you want to see what's pending, we have it in patchwork for wireless:
> https://patchwork.kernel.org/project/linux-wireless/list/
>
> The ath6kl one seems to be pending still on Jeff:
> https://patchwork.kernel.org/project/linux-wireless/patch/20251113162032.394804-2-marco.crivellari@suse.com/
Aha, nice, many thanks!
--
Marco Crivellari
L3 Support Engineer
^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: [PATCH 0/3] replace system_unbound_wq, add WQ_PERCPU to alloc_workqueue
2026-01-13 11:24 ` Marco Crivellari
@ 2026-01-14 0:42 ` Ping-Ke Shih
2026-01-14 9:20 ` Marco Crivellari
0 siblings, 1 reply; 11+ messages in thread
From: Ping-Ke Shih @ 2026-01-14 0:42 UTC (permalink / raw)
To: Marco Crivellari, Johannes Berg
Cc: linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org,
Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
Sebastian Andrzej Siewior, Michal Hocko
Marco Crivellari <marco.crivellari@suse.com> wrote:
> On Tue, Jan 13, 2026 at 12:19 PM Johannes Berg
> <johannes@sipsolutions.net> wrote:
> > OK cool, no worries. FWIW I might have even more in wireless-next:
> > https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git/
> >
> > If you want to see what's pending, we have it in patchwork for wireless:
> > https://patchwork.kernel.org/project/linux-wireless/list/
> >
> > The ath6kl one seems to be pending still on Jeff:
> >
> https://patchwork.kernel.org/project/linux-wireless/patch/20251113162032.394804-2-marco.crivellari@sus
> e.com/
>
> Aha, nice, many thanks!
>
The rtw88 one [1] is still queued on my hand, because it was wrongly applied [2]
causing regression and reverted by [3]. However, I have not rebased rtw-next
tree on top of wireless tree, so I can't apply [1]. Do you think this is urgent?
If so, I'd send a pull request to wireless-next right now since it is 6.19-rc5.
I don't want frequent pull-request that maintainers have extra load.
[1] https://patchwork.kernel.org/project/linux-wireless/patch/20251113160605.381777-3-marco.crivellari@suse.com/
[2] 9c194fe4625d ("wifi: rtw88: add WQ_UNBOUND to alloc_workqueue users")
[3] 0ff5e81e1518 ("Revert "wifi: rtw88: add WQ_UNBOUND to alloc_workqueue users"")
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH 0/3] replace system_unbound_wq, add WQ_PERCPU to alloc_workqueue
2026-01-14 0:42 ` Ping-Ke Shih
@ 2026-01-14 9:20 ` Marco Crivellari
0 siblings, 0 replies; 11+ messages in thread
From: Marco Crivellari @ 2026-01-14 9:20 UTC (permalink / raw)
To: Ping-Ke Shih
Cc: Johannes Berg, linux-kernel@vger.kernel.org,
linux-wireless@vger.kernel.org, Tejun Heo, Lai Jiangshan,
Frederic Weisbecker, Sebastian Andrzej Siewior, Michal Hocko
On Wed, Jan 14, 2026 at 1:42 AM Ping-Ke Shih <pkshih@realtek.com> wrote:
> [...]
> The rtw88 one [1] is still queued on my hand, because it was wrongly applied [2]
> causing regression and reverted by [3]. However, I have not rebased rtw-next
> tree on top of wireless tree, so I can't apply [1]. Do you think this is urgent?
> If so, I'd send a pull request to wireless-next right now since it is 6.19-rc5.
> I don't want frequent pull-request that maintainers have extra load.
>
> [1] https://patchwork.kernel.org/project/linux-wireless/patch/20251113160605.381777-3-marco.crivellari@suse.com/
> [2] 9c194fe4625d ("wifi: rtw88: add WQ_UNBOUND to alloc_workqueue users")
> [3] 0ff5e81e1518 ("Revert "wifi: rtw88: add WQ_UNBOUND to alloc_workqueue users"")
Hi,
I still have some other patches around, so if you have to posticipate
this to the next release is fine with me, no need to rush.
Thanks!
--
Marco Crivellari
L3 Support Engineer
^ permalink raw reply [flat|nested] 11+ messages in thread