Re: [RFC PATCH] platform/x86: asus-tf103c-dock: Move long delayed work on system_dfl_long_wq
From: Hans de Goede
Date: Thu May 07 2026 - 10:47:18 EST
Hi,
On 7-May-26 16:39, Marco Crivellari wrote:
> Currently the code enqueue work items using {queue|mod}_delayed_work(),
> using system_long_wq. This workqueue should be used when long works are
> expected and it is a per-cpu workqueue.
>
> The function(s) end up calling __queue_delayed_work(), which set a global
> timer that could fire anywhere, enqueuing the work where the timer fired.
>
> Unbound works could benefit from scheduler task placement, to optimize
> performance and power consumption. Long work shouldn't stick to a single
> CPU.
>
> Recently, a new unbound workqueue specific for long running work has
> been added:
>
> c116737e972e ("workqueue: Add system_dfl_long_wq for long unbound works")
>
> Since the workqueue work doesn't rely on per-cpu variables, there is no
> obvious reason that justify the use of a per-cpu workqueue. So change
> system_long_wq with system_dfl_long_wq so that the work may benefit from
> scheduler task placement.
>
> Signed-off-by: Marco Crivellari <marco.crivellari@xxxxxxxx>
Thanks, patch looks good to me:
Reviewed-by: Hans de Goede <johannes.goede@xxxxxxxxxxxxxxxx>
Regards,
Hans
> ---
> drivers/platform/x86/asus-tf103c-dock.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/platform/x86/asus-tf103c-dock.c b/drivers/platform/x86/asus-tf103c-dock.c
> index f09a3fc6524a..de683e17ce01 100644
> --- a/drivers/platform/x86/asus-tf103c-dock.c
> +++ b/drivers/platform/x86/asus-tf103c-dock.c
> @@ -669,7 +669,8 @@ static irqreturn_t tf103c_dock_hpd_irq(int irq, void *data)
> {
> struct tf103c_dock_data *dock = data;
>
> - mod_delayed_work(system_long_wq, &dock->hpd_work, TF103C_DOCK_HPD_DEBOUNCE);
> + mod_delayed_work(system_dfl_long_wq, &dock->hpd_work,
> + TF103C_DOCK_HPD_DEBOUNCE);
> return IRQ_HANDLED;
> }
>
> @@ -677,7 +678,8 @@ static void tf103c_dock_start_hpd(struct tf103c_dock_data *dock)
> {
> enable_irq(dock->hpd_irq);
> /* Sync current HPD status */
> - queue_delayed_work(system_long_wq, &dock->hpd_work, TF103C_DOCK_HPD_DEBOUNCE);
> + queue_delayed_work(system_dfl_long_wq, &dock->hpd_work,
> + TF103C_DOCK_HPD_DEBOUNCE);
> }
>
> static void tf103c_dock_stop_hpd(struct tf103c_dock_data *dock)