The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [RFC PATCH] platform/x86: asus-tf103c-dock: Move long delayed work on system_dfl_long_wq
@ 2026-05-07 14:39 Marco Crivellari
  2026-05-07 14:42 ` Hans de Goede
  0 siblings, 1 reply; 4+ messages in thread
From: Marco Crivellari @ 2026-05-07 14:39 UTC (permalink / raw)
  To: linux-kernel, platform-driver-x86
  Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
	Sebastian Andrzej Siewior, Marco Crivellari, Michal Hocko,
	Corentin Chary, Luke D . Jones, Denis Benato, Hans de Goede,
	Ilpo Jarvinen

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@suse.com>
---
 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)
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [RFC PATCH] platform/x86: asus-tf103c-dock: Move long delayed work on system_dfl_long_wq
  2026-05-07 14:39 [RFC PATCH] platform/x86: asus-tf103c-dock: Move long delayed work on system_dfl_long_wq Marco Crivellari
@ 2026-05-07 14:42 ` Hans de Goede
  2026-05-08 13:34   ` Ilpo Järvinen
  0 siblings, 1 reply; 4+ messages in thread
From: Hans de Goede @ 2026-05-07 14:42 UTC (permalink / raw)
  To: Marco Crivellari, linux-kernel, platform-driver-x86
  Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
	Sebastian Andrzej Siewior, Michal Hocko, Corentin Chary,
	Luke D . Jones, Denis Benato, Ilpo Jarvinen

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@suse.com>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>

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)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC PATCH] platform/x86: asus-tf103c-dock: Move long delayed work on system_dfl_long_wq
  2026-05-07 14:42 ` Hans de Goede
@ 2026-05-08 13:34   ` Ilpo Järvinen
  2026-05-08 14:24     ` Marco Crivellari
  0 siblings, 1 reply; 4+ messages in thread
From: Ilpo Järvinen @ 2026-05-08 13:34 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Marco Crivellari, LKML, platform-driver-x86, Tejun Heo,
	Lai Jiangshan, Frederic Weisbecker, Sebastian Andrzej Siewior,
	Michal Hocko, Corentin Chary, Luke D . Jones, Denis Benato

[-- Attachment #1: Type: text/plain, Size: 2577 bytes --]

On Thu, 7 May 2026, Hans de Goede wrote:

> 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@suse.com>
> 
> Thanks, patch looks good to me:
> 
> Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
> 
> 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)
> 

Hi Marco,

Is there some particular reason why this was sent as RFC?

-- 
 i.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC PATCH] platform/x86: asus-tf103c-dock: Move long delayed work on system_dfl_long_wq
  2026-05-08 13:34   ` Ilpo Järvinen
@ 2026-05-08 14:24     ` Marco Crivellari
  0 siblings, 0 replies; 4+ messages in thread
From: Marco Crivellari @ 2026-05-08 14:24 UTC (permalink / raw)
  To: Ilpo Järvinen
  Cc: Hans de Goede, LKML, platform-driver-x86, Tejun Heo,
	Lai Jiangshan, Frederic Weisbecker, Sebastian Andrzej Siewior,
	Michal Hocko, Corentin Chary, Luke D . Jones, Denis Benato

On Fri, May 8, 2026 at 3:34 PM Ilpo Järvinen
<ilpo.jarvinen@linux.intel.com> wrote:
> Hi Marco,
>
> Is there some particular reason why this was sent as RFC?
>

Hi Ilpo,

The only reason was to ensure my check regarding per-cpu variables was
sufficient and that there was no specific reason to keep them per-CPU,
and to comment on it if necessary.

Thanks!

-- 

Marco Crivellari

SUSE Labs

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-05-08 14:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-07 14:39 [RFC PATCH] platform/x86: asus-tf103c-dock: Move long delayed work on system_dfl_long_wq Marco Crivellari
2026-05-07 14:42 ` Hans de Goede
2026-05-08 13:34   ` Ilpo Järvinen
2026-05-08 14:24     ` Marco Crivellari

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox