All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpufreq: governor: Always schedule work on the CPU running update
@ 2016-03-22  0:17 Rafael J. Wysocki
  2016-03-22  2:51 ` Viresh Kumar
  0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2016-03-22  0:17 UTC (permalink / raw)
  To: Linux PM list; +Cc: Linux Kernel Mailing List, Viresh Kumar

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Modify dbs_irq_work() to always schedule the process-context work
on the current CPU which also ran the dbs_update_util_handler()
that the irq_work being handled came from.

This causes the entire frequency update handling (involving the
"ondemand" or "conservative" governors) to be carried out by the
CPU whose frequency is to be updated and reduces the overall amount
of inter-CPU noise related to cpufreq.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/cpufreq/cpufreq_governor.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-pm/drivers/cpufreq/cpufreq_governor.c
===================================================================
--- linux-pm.orig/drivers/cpufreq/cpufreq_governor.c
+++ linux-pm/drivers/cpufreq/cpufreq_governor.c
@@ -245,7 +245,7 @@ static void dbs_irq_work(struct irq_work
 	struct policy_dbs_info *policy_dbs;
 
 	policy_dbs = container_of(irq_work, struct policy_dbs_info, irq_work);
-	schedule_work(&policy_dbs->work);
+	schedule_work_on(smp_processor_id(), &policy_dbs->work);
 }
 
 static void dbs_update_util_handler(struct update_util_data *data, u64 time,

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

* Re: [PATCH] cpufreq: governor: Always schedule work on the CPU running update
  2016-03-22  0:17 [PATCH] cpufreq: governor: Always schedule work on the CPU running update Rafael J. Wysocki
@ 2016-03-22  2:51 ` Viresh Kumar
  2016-03-22  4:51   ` Mike Galbraith
  0 siblings, 1 reply; 3+ messages in thread
From: Viresh Kumar @ 2016-03-22  2:51 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Linux PM list, Linux Kernel Mailing List

On 22-03-16, 01:17, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> Modify dbs_irq_work() to always schedule the process-context work
> on the current CPU which also ran the dbs_update_util_handler()
> that the irq_work being handled came from.
> 
> This causes the entire frequency update handling (involving the
> "ondemand" or "conservative" governors) to be carried out by the
> CPU whose frequency is to be updated and reduces the overall amount
> of inter-CPU noise related to cpufreq.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>  drivers/cpufreq/cpufreq_governor.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: linux-pm/drivers/cpufreq/cpufreq_governor.c
> ===================================================================
> --- linux-pm.orig/drivers/cpufreq/cpufreq_governor.c
> +++ linux-pm/drivers/cpufreq/cpufreq_governor.c
> @@ -245,7 +245,7 @@ static void dbs_irq_work(struct irq_work
>  	struct policy_dbs_info *policy_dbs;
>  
>  	policy_dbs = container_of(irq_work, struct policy_dbs_info, irq_work);
> -	schedule_work(&policy_dbs->work);
> +	schedule_work_on(smp_processor_id(), &policy_dbs->work);
>  }
>  
>  static void dbs_update_util_handler(struct update_util_data *data, u64 time,

queue_work() used to queue the work on local cpu by default, has that
changed now ?

-- 
viresh

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

* Re: [PATCH] cpufreq: governor: Always schedule work on the CPU running update
  2016-03-22  2:51 ` Viresh Kumar
@ 2016-03-22  4:51   ` Mike Galbraith
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Galbraith @ 2016-03-22  4:51 UTC (permalink / raw)
  To: Viresh Kumar, Rafael J. Wysocki; +Cc: Linux PM list, Linux Kernel Mailing List

On Tue, 2016-03-22 at 08:21 +0530, Viresh Kumar wrote:
> On 22-03-16, 01:17, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > 
> > Modify dbs_irq_work() to always schedule the process-context work
> > on the current CPU which also ran the dbs_update_util_handler()
> > that the irq_work being handled came from.
> > 
> > This causes the entire frequency update handling (involving the
> > "ondemand" or "conservative" governors) to be carried out by the
> > CPU whose frequency is to be updated and reduces the overall amount
> > of inter-CPU noise related to cpufreq.
> > 
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > ---
> >  drivers/cpufreq/cpufreq_governor.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > Index: linux-pm/drivers/cpufreq/cpufreq_governor.c
> > ===================================================================
> > --- linux-pm.orig/drivers/cpufreq/cpufreq_governor.c
> > +++ linux-pm/drivers/cpufreq/cpufreq_governor.c
> > @@ -245,7 +245,7 @@ static void dbs_irq_work(struct irq_work
> >  	struct policy_dbs_info *policy_dbs;
> >  
> >  	policy_dbs = container_of(irq_work,
> > structwq_unbound_cpumask policy_dbs_info, irq_work);
> > -	schedule_work(&policy_dbs->work);
> > +	schedule_work_on(smp_processor_id(), &policy_dbs->work);
> >  }
> >  
> >  static void dbs_update_util_handler(struct update_util_data *data,
> > u64 time,
> 
> queue_work() used to queue the work on local cpu by default, has that
> changed now ?

By default it still will, but the user now has the option to deflect
work items with an unspecified target.  These will land on a CPU
included in wq_unbound_cpumask iff the current CPU is excluded
therefrom.

	-Mike

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

end of thread, other threads:[~2016-03-22  4:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-22  0:17 [PATCH] cpufreq: governor: Always schedule work on the CPU running update Rafael J. Wysocki
2016-03-22  2:51 ` Viresh Kumar
2016-03-22  4:51   ` Mike Galbraith

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.