* [PATCH v2 1/3] platform/surface: acpi-notify: add WQ_PERCPU to alloc_workqueue users
2025-11-27 14:41 [PATCH v2 0/3] replace uses of system_wq with system_percpu_wq, request alloc_workqueue to be per-cpu Marco Crivellari
@ 2025-11-27 14:41 ` Marco Crivellari
2025-11-27 14:41 ` [PATCH v2 2/3] platform: x86: replace use of system_wq with system_percpu_wq Marco Crivellari
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Marco Crivellari @ 2025-11-27 14:41 UTC (permalink / raw)
To: linux-kernel, platform-driver-x86
Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
Sebastian Andrzej Siewior, Marco Crivellari, Michal Hocko,
Maximilian Luz, Hans de Goede, Ilpo Jarvinen
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")
The refactoring is going to alter the default behavior of
alloc_workqueue() to be unbound by default.
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. For more details see the Link tag below.
In order to keep alloc_workqueue() behavior identical, explicitly request
WQ_PERCPU.
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/platform/surface/surface_acpi_notify.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/surface/surface_acpi_notify.c b/drivers/platform/surface/surface_acpi_notify.c
index 3b30cfe3466b..a9dcb0bbe90e 100644
--- a/drivers/platform/surface/surface_acpi_notify.c
+++ b/drivers/platform/surface/surface_acpi_notify.c
@@ -862,7 +862,7 @@ static int __init san_init(void)
{
int ret;
- san_wq = alloc_workqueue("san_wq", 0, 0);
+ san_wq = alloc_workqueue("san_wq", WQ_PERCPU, 0);
if (!san_wq)
return -ENOMEM;
ret = platform_driver_register(&surface_acpi_notify);
--
2.51.1
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH v2 2/3] platform: x86: replace use of system_wq with system_percpu_wq
2025-11-27 14:41 [PATCH v2 0/3] replace uses of system_wq with system_percpu_wq, request alloc_workqueue to be per-cpu Marco Crivellari
2025-11-27 14:41 ` [PATCH v2 1/3] platform/surface: acpi-notify: add WQ_PERCPU to alloc_workqueue users Marco Crivellari
@ 2025-11-27 14:41 ` Marco Crivellari
2025-11-27 14:41 ` [PATCH v2 3/3] platform: surface: " Marco Crivellari
2025-11-28 10:25 ` [PATCH v2 0/3] replace uses of system_wq with system_percpu_wq, request alloc_workqueue to be per-cpu Ilpo Järvinen
3 siblings, 0 replies; 6+ messages in thread
From: Marco Crivellari @ 2025-11-27 14:41 UTC (permalink / raw)
To: linux-kernel, platform-driver-x86
Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
Sebastian Andrzej Siewior, Marco Crivellari, Michal Hocko,
Maximilian Luz, Hans de Goede, Ilpo Jarvinen
This patch continues the effort to refactor workqueue APIs, which has begun
with the changes 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")
The point of the refactoring is to eventually alter the default behavior of
workqueues to become unbound by default so that their workload placement is
optimized by the scheduler.
Before that to happen after a careful review and conversion of each individual
case, workqueue users must be converted to the better named new workqueues with
no intended behaviour changes:
system_wq -> system_percpu_wq
system_unbound_wq -> system_dfl_wq
This way the old obsolete workqueues (system_wq, system_unbound_wq) can be
removed in the future.
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/platform/x86/gpd-pocket-fan.c | 4 ++--
drivers/platform/x86/x86-android-tablets/vexia_atla10_ec.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/platform/x86/gpd-pocket-fan.c b/drivers/platform/x86/gpd-pocket-fan.c
index 7a20f68ae206..c9236738f896 100644
--- a/drivers/platform/x86/gpd-pocket-fan.c
+++ b/drivers/platform/x86/gpd-pocket-fan.c
@@ -112,14 +112,14 @@ static void gpd_pocket_fan_worker(struct work_struct *work)
gpd_pocket_fan_set_speed(fan, speed);
/* When mostly idle (low temp/speed), slow down the poll interval. */
- queue_delayed_work(system_wq, &fan->work,
+ queue_delayed_work(system_percpu_wq, &fan->work,
msecs_to_jiffies(4000 / (speed + 1)));
}
static void gpd_pocket_fan_force_update(struct gpd_pocket_fan_data *fan)
{
fan->last_speed = -1;
- mod_delayed_work(system_wq, &fan->work, 0);
+ mod_delayed_work(system_percpu_wq, &fan->work, 0);
}
static int gpd_pocket_fan_probe(struct platform_device *pdev)
diff --git a/drivers/platform/x86/x86-android-tablets/vexia_atla10_ec.c b/drivers/platform/x86/x86-android-tablets/vexia_atla10_ec.c
index 2f8cd8d9e0ab..ebbedfe5f4e8 100644
--- a/drivers/platform/x86/x86-android-tablets/vexia_atla10_ec.c
+++ b/drivers/platform/x86/x86-android-tablets/vexia_atla10_ec.c
@@ -183,7 +183,7 @@ static void atla10_ec_external_power_changed(struct power_supply *psy)
struct atla10_ec_data *data = power_supply_get_drvdata(psy);
/* After charger plug in/out wait 0.5s for things to stabilize */
- mod_delayed_work(system_wq, &data->work, HZ / 2);
+ mod_delayed_work(system_percpu_wq, &data->work, HZ / 2);
}
static const enum power_supply_property atla10_ec_psy_props[] = {
--
2.51.1
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH v2 3/3] platform: surface: replace use of system_wq with system_percpu_wq
2025-11-27 14:41 [PATCH v2 0/3] replace uses of system_wq with system_percpu_wq, request alloc_workqueue to be per-cpu Marco Crivellari
2025-11-27 14:41 ` [PATCH v2 1/3] platform/surface: acpi-notify: add WQ_PERCPU to alloc_workqueue users Marco Crivellari
2025-11-27 14:41 ` [PATCH v2 2/3] platform: x86: replace use of system_wq with system_percpu_wq Marco Crivellari
@ 2025-11-27 14:41 ` Marco Crivellari
2025-11-28 10:25 ` [PATCH v2 0/3] replace uses of system_wq with system_percpu_wq, request alloc_workqueue to be per-cpu Ilpo Järvinen
3 siblings, 0 replies; 6+ messages in thread
From: Marco Crivellari @ 2025-11-27 14:41 UTC (permalink / raw)
To: linux-kernel, platform-driver-x86
Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
Sebastian Andrzej Siewior, Marco Crivellari, Michal Hocko,
Maximilian Luz, Hans de Goede, Ilpo Jarvinen
This patch continues the effort to refactor workqueue APIs, which has begun
with the changes 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")
The point of the refactoring is to eventually alter the default behavior of
workqueues to become unbound by default so that their workload placement is
optimized by the scheduler.
Before that to happen after a careful review and conversion of each individual
case, workqueue users must be converted to the better named new workqueues with
no intended behaviour changes:
system_wq -> system_percpu_wq
system_unbound_wq -> system_dfl_wq
This way the old obsolete workqueues (system_wq, system_unbound_wq) can be
removed in the future.
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/platform/surface/aggregator/ssh_packet_layer.c | 2 +-
drivers/platform/surface/aggregator/ssh_request_layer.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/surface/aggregator/ssh_packet_layer.c b/drivers/platform/surface/aggregator/ssh_packet_layer.c
index 6081b0146d5f..3dd22856570f 100644
--- a/drivers/platform/surface/aggregator/ssh_packet_layer.c
+++ b/drivers/platform/surface/aggregator/ssh_packet_layer.c
@@ -671,7 +671,7 @@ static void ssh_ptl_timeout_reaper_mod(struct ssh_ptl *ptl, ktime_t now,
/* Re-adjust / schedule reaper only if it is above resolution delta. */
if (ktime_before(aexp, ptl->rtx_timeout.expires)) {
ptl->rtx_timeout.expires = expires;
- mod_delayed_work(system_wq, &ptl->rtx_timeout.reaper, delta);
+ mod_delayed_work(system_percpu_wq, &ptl->rtx_timeout.reaper, delta);
}
spin_unlock(&ptl->rtx_timeout.lock);
diff --git a/drivers/platform/surface/aggregator/ssh_request_layer.c b/drivers/platform/surface/aggregator/ssh_request_layer.c
index 879ca9ee7ff6..a356e4956562 100644
--- a/drivers/platform/surface/aggregator/ssh_request_layer.c
+++ b/drivers/platform/surface/aggregator/ssh_request_layer.c
@@ -434,7 +434,7 @@ static void ssh_rtl_timeout_reaper_mod(struct ssh_rtl *rtl, ktime_t now,
/* Re-adjust / schedule reaper only if it is above resolution delta. */
if (ktime_before(aexp, rtl->rtx_timeout.expires)) {
rtl->rtx_timeout.expires = expires;
- mod_delayed_work(system_wq, &rtl->rtx_timeout.reaper, delta);
+ mod_delayed_work(system_percpu_wq, &rtl->rtx_timeout.reaper, delta);
}
spin_unlock(&rtl->rtx_timeout.lock);
--
2.51.1
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH v2 0/3] replace uses of system_wq with system_percpu_wq, request alloc_workqueue to be per-cpu
2025-11-27 14:41 [PATCH v2 0/3] replace uses of system_wq with system_percpu_wq, request alloc_workqueue to be per-cpu Marco Crivellari
` (2 preceding siblings ...)
2025-11-27 14:41 ` [PATCH v2 3/3] platform: surface: " Marco Crivellari
@ 2025-11-28 10:25 ` Ilpo Järvinen
2025-11-28 16:28 ` Marco Crivellari
3 siblings, 1 reply; 6+ messages in thread
From: Ilpo Järvinen @ 2025-11-28 10:25 UTC (permalink / raw)
To: linux-kernel, platform-driver-x86, Marco Crivellari
Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
Sebastian Andrzej Siewior, Michal Hocko, Maximilian Luz,
Hans de Goede
On Thu, 27 Nov 2025 15:41:22 +0100, Marco Crivellari wrote:
> 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")
>
> More information can be found at the link below:
>
> [...]
Thank you for your contribution, it has been applied to my local
review-ilpo-next branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-next branch only once I've pushed my
local branch there, which might take a while.
The list of commits applied:
[1/3] platform/surface: acpi-notify: add WQ_PERCPU to alloc_workqueue users
commit: f03dd5dd736d6aea94406a273be2a10f84bc60e1
[2/3] platform: x86: replace use of system_wq with system_percpu_wq
commit: db4399501c58ad1225105224e7c9f03bc3d4fe39
[3/3] platform: surface: replace use of system_wq with system_percpu_wq
commit: f720239ca39d72657e1bbf9c4c6270c78f548e43
--
i.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH v2 0/3] replace uses of system_wq with system_percpu_wq, request alloc_workqueue to be per-cpu
2025-11-28 10:25 ` [PATCH v2 0/3] replace uses of system_wq with system_percpu_wq, request alloc_workqueue to be per-cpu Ilpo Järvinen
@ 2025-11-28 16:28 ` Marco Crivellari
0 siblings, 0 replies; 6+ messages in thread
From: Marco Crivellari @ 2025-11-28 16:28 UTC (permalink / raw)
To: Ilpo Järvinen
Cc: linux-kernel, platform-driver-x86, Tejun Heo, Lai Jiangshan,
Frederic Weisbecker, Sebastian Andrzej Siewior, Michal Hocko,
Maximilian Luz, Hans de Goede
On Fri, Nov 28, 2025 at 11:25 AM Ilpo Järvinen
<ilpo.jarvinen@linux.intel.com> wrote:
> [...]
> Thank you for your contribution, it has been applied to my local
> review-ilpo-next branch. Note it will show up in the public
> platform-drivers-x86/review-ilpo-next branch only once I've pushed my
> local branch there, which might take a while.
>
> The list of commits applied:
> [1/3] platform/surface: acpi-notify: add WQ_PERCPU to alloc_workqueue users
> commit: f03dd5dd736d6aea94406a273be2a10f84bc60e1
> [2/3] platform: x86: replace use of system_wq with system_percpu_wq
> commit: db4399501c58ad1225105224e7c9f03bc3d4fe39
> [3/3] platform: surface: replace use of system_wq with system_percpu_wq
> commit: f720239ca39d72657e1bbf9c4c6270c78f548e43
Many thanks!
--
Marco Crivellari
L3 Support Engineer, Technology & Product
^ permalink raw reply [flat|nested] 6+ messages in thread