All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched/fair: Invoke cpufreq hooks for CONFIG_SMP unset
@ 2016-05-06 12:58 Rafael J. Wysocki
  2016-05-06 19:08 ` Steve Muckle
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Rafael J. Wysocki @ 2016-05-06 12:58 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Linux PM list, Linux Kernel Mailing List, Viresh Kumar,
	Srinivas Pandruvada, Steve Muckle, Ingo Molnar

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

Commit 34e2c555f3e1 (cpufreq: Add mechanism for registering utilization
update callbacks) overlooked the fact that update_load_avg(), where
CFS invokes cpufreq utilization update hooks, becomes an empty stub for
CONFIG_SMP unset.  In consequence, if CONFIG_SMP is not set, cpufreq
governors are never invoked from CFS and they do not have a chance to
evaluate CPU performace levels and update them often enough.  Needless
to say, things don't work as expected then.

Fix the problem by making the !CONFIG_SMP stub of update_load_avg()
invoke cpufreq update hooks too.

Fixes: 34e2c555f3e1 (cpufreq: Add mechanism for registering utilization update callbacks)
Reported-by: Steve Muckle <steve.muckle@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---

This needs to go into v4.6.

---
 kernel/sched/fair.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Index: linux-pm/kernel/sched/fair.c
===================================================================
--- linux-pm.orig/kernel/sched/fair.c
+++ linux-pm/kernel/sched/fair.c
@@ -3030,7 +3030,14 @@ static int idle_balance(struct rq *this_
 
 #else /* CONFIG_SMP */
 
-static inline void update_load_avg(struct sched_entity *se, int update_tg) {}
+static inline void update_load_avg(struct sched_entity *se, int not_used)
+{
+	struct cfs_rq *cfs_rq = cfs_rq_of(se);
+	struct rq *rq = rq_of(cfs_rq);
+
+	cpufreq_trigger_update(rq_clock(rq));
+}
+
 static inline void
 enqueue_entity_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se) {}
 static inline void


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

* Re: [PATCH] sched/fair: Invoke cpufreq hooks for CONFIG_SMP unset
  2016-05-06 12:58 [PATCH] sched/fair: Invoke cpufreq hooks for CONFIG_SMP unset Rafael J. Wysocki
@ 2016-05-06 19:08 ` Steve Muckle
  2016-05-06 19:36   ` Rafael J. Wysocki
  2016-05-07  6:13 ` Peter Zijlstra
  2016-05-07  6:37 ` [tip:sched/urgent] sched/fair: Fix !CONFIG_SMP kernel cpufreq governor breakage tip-bot for Rafael J. Wysocki
  2 siblings, 1 reply; 10+ messages in thread
From: Steve Muckle @ 2016-05-06 19:08 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Peter Zijlstra, Linux PM list, Linux Kernel Mailing List,
	Viresh Kumar, Srinivas Pandruvada, Steve Muckle, Ingo Molnar

Looks good to me.

Also re-tested with intel_pstate on i7-3630QM !SMP, confirmed issue
is resolved. I didn't retest with ondemand because for some reason
that wasn't showing the problem before.

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

* Re: [PATCH] sched/fair: Invoke cpufreq hooks for CONFIG_SMP unset
  2016-05-06 19:08 ` Steve Muckle
@ 2016-05-06 19:36   ` Rafael J. Wysocki
  0 siblings, 0 replies; 10+ messages in thread
From: Rafael J. Wysocki @ 2016-05-06 19:36 UTC (permalink / raw)
  To: Steve Muckle
  Cc: Peter Zijlstra, Linux PM list, Linux Kernel Mailing List,
	Viresh Kumar, Srinivas Pandruvada, Ingo Molnar

On Friday, May 06, 2016 12:08:25 PM Steve Muckle wrote:
> Looks good to me.
> 
> Also re-tested with intel_pstate on i7-3630QM !SMP, confirmed issue
> is resolved.

Thanks!

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

* Re: [PATCH] sched/fair: Invoke cpufreq hooks for CONFIG_SMP unset
  2016-05-06 12:58 [PATCH] sched/fair: Invoke cpufreq hooks for CONFIG_SMP unset Rafael J. Wysocki
  2016-05-06 19:08 ` Steve Muckle
@ 2016-05-07  6:13 ` Peter Zijlstra
  2016-05-07  6:30   ` Ingo Molnar
  2016-05-07  6:37 ` [tip:sched/urgent] sched/fair: Fix !CONFIG_SMP kernel cpufreq governor breakage tip-bot for Rafael J. Wysocki
  2 siblings, 1 reply; 10+ messages in thread
From: Peter Zijlstra @ 2016-05-07  6:13 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linux PM list, Linux Kernel Mailing List, Viresh Kumar,
	Srinivas Pandruvada, Steve Muckle, Ingo Molnar

On Fri, May 06, 2016 at 02:58:43PM +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> Commit 34e2c555f3e1 (cpufreq: Add mechanism for registering utilization
> update callbacks) overlooked the fact that update_load_avg(), where
> CFS invokes cpufreq utilization update hooks, becomes an empty stub for
> CONFIG_SMP unset.  In consequence, if CONFIG_SMP is not set, cpufreq
> governors are never invoked from CFS and they do not have a chance to
> evaluate CPU performace levels and update them often enough.  Needless
> to say, things don't work as expected then.
> 
> Fix the problem by making the !CONFIG_SMP stub of update_load_avg()
> invoke cpufreq update hooks too.
> 
> Fixes: 34e2c555f3e1 (cpufreq: Add mechanism for registering utilization update callbacks)
> Reported-by: Steve Muckle <steve.muckle@linaro.org>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Rafael; feel free to push this through the pm tree.

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>

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

* Re: [PATCH] sched/fair: Invoke cpufreq hooks for CONFIG_SMP unset
  2016-05-07  6:13 ` Peter Zijlstra
@ 2016-05-07  6:30   ` Ingo Molnar
  2016-05-09  8:30     ` Peter Zijlstra
  2016-05-09 23:53     ` Steve Muckle
  0 siblings, 2 replies; 10+ messages in thread
From: Ingo Molnar @ 2016-05-07  6:30 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Rafael J. Wysocki, Linux PM list, Linux Kernel Mailing List,
	Viresh Kumar, Srinivas Pandruvada, Steve Muckle


* Peter Zijlstra <peterz@infradead.org> wrote:

> On Fri, May 06, 2016 at 02:58:43PM +0200, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > 
> > Commit 34e2c555f3e1 (cpufreq: Add mechanism for registering utilization
> > update callbacks) overlooked the fact that update_load_avg(), where
> > CFS invokes cpufreq utilization update hooks, becomes an empty stub for
> > CONFIG_SMP unset.  In consequence, if CONFIG_SMP is not set, cpufreq
> > governors are never invoked from CFS and they do not have a chance to
> > evaluate CPU performace levels and update them often enough.  Needless
> > to say, things don't work as expected then.
> > 
> > Fix the problem by making the !CONFIG_SMP stub of update_load_avg()
> > invoke cpufreq update hooks too.
> > 
> > Fixes: 34e2c555f3e1 (cpufreq: Add mechanism for registering utilization update callbacks)
> > Reported-by: Steve Muckle <steve.muckle@linaro.org>
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> Rafael; feel free to push this through the pm tree.
> 
> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>

I already have it in sched/urgent.

Thanks,

	Ingo

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

* [tip:sched/urgent] sched/fair: Fix !CONFIG_SMP kernel cpufreq governor breakage
  2016-05-06 12:58 [PATCH] sched/fair: Invoke cpufreq hooks for CONFIG_SMP unset Rafael J. Wysocki
  2016-05-06 19:08 ` Steve Muckle
  2016-05-07  6:13 ` Peter Zijlstra
@ 2016-05-07  6:37 ` tip-bot for Rafael J. Wysocki
  2 siblings, 0 replies; 10+ messages in thread
From: tip-bot for Rafael J. Wysocki @ 2016-05-07  6:37 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: hpa, linux-kernel, peterz, mingo, rafael.j.wysocki, tglx,
	linux-pm, steve.muckle, srinivas.pandruvada, torvalds,
	viresh.kumar

Commit-ID:  536bd00cdbb7b908573e5a93bae67b64cbae60d8
Gitweb:     http://git.kernel.org/tip/536bd00cdbb7b908573e5a93bae67b64cbae60d8
Author:     Rafael J. Wysocki <rafael.j.wysocki@intel.com>
AuthorDate: Fri, 6 May 2016 14:58:43 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Sat, 7 May 2016 07:45:34 +0200

sched/fair: Fix !CONFIG_SMP kernel cpufreq governor breakage

The following commit:

  34e2c555f3e1 ("cpufreq: Add mechanism for registering utilization update callbacks")

overlooked the fact that update_load_avg(), where CFS invokes cpufreq
utilization update callbacks, becomes an empty stub on UP kernels.

In consequence, if !CONFIG_SMP, cpufreq governors are never invoked
from CFS and they do not have a chance to evaluate CPU performace
levels and update them often enough.

Needless to say, things don't work as expected then.

Fix the problem by making the !CONFIG_SMP stub of update_load_avg()
invoke cpufreq update callbacks too.

Reported-by: Steve Muckle <steve.muckle@linaro.org>
Tested-by: Steve Muckle <steve.muckle@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Steve Muckle <steve.muckle@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linux PM list <linux-pm@vger.kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Fixes: 34e2c555f3e1 (cpufreq: Add mechanism for registering utilization update callbacks)
Link: http://lkml.kernel.org/r/6282396.VVEdgVYxO3@vostro.rjw.lan
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/sched/fair.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 0fe30e6..40748dc 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3030,7 +3030,14 @@ static int idle_balance(struct rq *this_rq);
 
 #else /* CONFIG_SMP */
 
-static inline void update_load_avg(struct sched_entity *se, int update_tg) {}
+static inline void update_load_avg(struct sched_entity *se, int not_used)
+{
+	struct cfs_rq *cfs_rq = cfs_rq_of(se);
+	struct rq *rq = rq_of(cfs_rq);
+
+	cpufreq_trigger_update(rq_clock(rq));
+}
+
 static inline void
 enqueue_entity_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se) {}
 static inline void

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

* Re: [PATCH] sched/fair: Invoke cpufreq hooks for CONFIG_SMP unset
  2016-05-07  6:30   ` Ingo Molnar
@ 2016-05-09  8:30     ` Peter Zijlstra
  2016-05-09 23:53     ` Steve Muckle
  1 sibling, 0 replies; 10+ messages in thread
From: Peter Zijlstra @ 2016-05-09  8:30 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Rafael J. Wysocki, Linux PM list, Linux Kernel Mailing List,
	Viresh Kumar, Srinivas Pandruvada, Steve Muckle

On Sat, May 07, 2016 at 08:30:51AM +0200, Ingo Molnar wrote:
> * Peter Zijlstra <peterz@infradead.org> wrote:

> > Rafael; feel free to push this through the pm tree.
> > 
> > Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> 
> I already have it in sched/urgent.

Ah, indeed you did, I must've missed that, thanks!

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

* Re: [PATCH] sched/fair: Invoke cpufreq hooks for CONFIG_SMP unset
  2016-05-07  6:30   ` Ingo Molnar
  2016-05-09  8:30     ` Peter Zijlstra
@ 2016-05-09 23:53     ` Steve Muckle
  2016-05-09 23:58       ` Rafael J. Wysocki
  1 sibling, 1 reply; 10+ messages in thread
From: Steve Muckle @ 2016-05-09 23:53 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Peter Zijlstra, Rafael J. Wysocki, Linux PM list,
	Linux Kernel Mailing List, Viresh Kumar, Srinivas Pandruvada,
	Steve Muckle

On Sat, May 07, 2016 at 08:30:51AM +0200, Ingo Molnar wrote:
> 
> * Peter Zijlstra <peterz@infradead.org> wrote:
> 
> > On Fri, May 06, 2016 at 02:58:43PM +0200, Rafael J. Wysocki wrote:
> > > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > > 
> > > Commit 34e2c555f3e1 (cpufreq: Add mechanism for registering utilization
> > > update callbacks) overlooked the fact that update_load_avg(), where
> > > CFS invokes cpufreq utilization update hooks, becomes an empty stub for
> > > CONFIG_SMP unset.  In consequence, if CONFIG_SMP is not set, cpufreq
> > > governors are never invoked from CFS and they do not have a chance to
> > > evaluate CPU performace levels and update them often enough.  Needless
> > > to say, things don't work as expected then.
> > > 
> > > Fix the problem by making the !CONFIG_SMP stub of update_load_avg()
> > > invoke cpufreq update hooks too.
> > > 
> > > Fixes: 34e2c555f3e1 (cpufreq: Add mechanism for registering utilization update callbacks)
> > > Reported-by: Steve Muckle <steve.muckle@linaro.org>
> > > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > 
> > Rafael; feel free to push this through the pm tree.
> > 
> > Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> 
> I already have it in sched/urgent.

Looks like this just missed 4.6-rc7 and the release email for
that doesn't suggest an rc8, as it stands...

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

* Re: [PATCH] sched/fair: Invoke cpufreq hooks for CONFIG_SMP unset
  2016-05-09 23:53     ` Steve Muckle
@ 2016-05-09 23:58       ` Rafael J. Wysocki
  2016-05-10  8:13         ` Ingo Molnar
  0 siblings, 1 reply; 10+ messages in thread
From: Rafael J. Wysocki @ 2016-05-09 23:58 UTC (permalink / raw)
  To: Steve Muckle
  Cc: Ingo Molnar, Peter Zijlstra, Linux PM list,
	Linux Kernel Mailing List, Viresh Kumar, Srinivas Pandruvada

On Monday, May 09, 2016 04:53:16 PM Steve Muckle wrote:
> On Sat, May 07, 2016 at 08:30:51AM +0200, Ingo Molnar wrote:
> > 
> > * Peter Zijlstra <peterz@infradead.org> wrote:
> > 
> > > On Fri, May 06, 2016 at 02:58:43PM +0200, Rafael J. Wysocki wrote:
> > > > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > > > 
> > > > Commit 34e2c555f3e1 (cpufreq: Add mechanism for registering utilization
> > > > update callbacks) overlooked the fact that update_load_avg(), where
> > > > CFS invokes cpufreq utilization update hooks, becomes an empty stub for
> > > > CONFIG_SMP unset.  In consequence, if CONFIG_SMP is not set, cpufreq
> > > > governors are never invoked from CFS and they do not have a chance to
> > > > evaluate CPU performace levels and update them often enough.  Needless
> > > > to say, things don't work as expected then.
> > > > 
> > > > Fix the problem by making the !CONFIG_SMP stub of update_load_avg()
> > > > invoke cpufreq update hooks too.
> > > > 
> > > > Fixes: 34e2c555f3e1 (cpufreq: Add mechanism for registering utilization update callbacks)
> > > > Reported-by: Steve Muckle <steve.muckle@linaro.org>
> > > > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > > 
> > > Rafael; feel free to push this through the pm tree.
> > > 
> > > Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> > 
> > I already have it in sched/urgent.
> 
> Looks like this just missed 4.6-rc7 and the release email for
> that doesn't suggest an rc8, as it stands...

But the final 4.6 will be released on Sunday or so and there are a few days
left still.


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

* Re: [PATCH] sched/fair: Invoke cpufreq hooks for CONFIG_SMP unset
  2016-05-09 23:58       ` Rafael J. Wysocki
@ 2016-05-10  8:13         ` Ingo Molnar
  0 siblings, 0 replies; 10+ messages in thread
From: Ingo Molnar @ 2016-05-10  8:13 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Steve Muckle, Peter Zijlstra, Linux PM list,
	Linux Kernel Mailing List, Viresh Kumar, Srinivas Pandruvada


* Rafael J. Wysocki <rjw@rjwysocki.net> wrote:

> On Monday, May 09, 2016 04:53:16 PM Steve Muckle wrote:
> > On Sat, May 07, 2016 at 08:30:51AM +0200, Ingo Molnar wrote:
> > > 
> > > * Peter Zijlstra <peterz@infradead.org> wrote:
> > > 
> > > > On Fri, May 06, 2016 at 02:58:43PM +0200, Rafael J. Wysocki wrote:
> > > > > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > > > > 
> > > > > Commit 34e2c555f3e1 (cpufreq: Add mechanism for registering utilization
> > > > > update callbacks) overlooked the fact that update_load_avg(), where
> > > > > CFS invokes cpufreq utilization update hooks, becomes an empty stub for
> > > > > CONFIG_SMP unset.  In consequence, if CONFIG_SMP is not set, cpufreq
> > > > > governors are never invoked from CFS and they do not have a chance to
> > > > > evaluate CPU performace levels and update them often enough.  Needless
> > > > > to say, things don't work as expected then.
> > > > > 
> > > > > Fix the problem by making the !CONFIG_SMP stub of update_load_avg()
> > > > > invoke cpufreq update hooks too.
> > > > > 
> > > > > Fixes: 34e2c555f3e1 (cpufreq: Add mechanism for registering utilization update callbacks)
> > > > > Reported-by: Steve Muckle <steve.muckle@linaro.org>
> > > > > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > > > 
> > > > Rafael; feel free to push this through the pm tree.
> > > > 
> > > > Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> > > 
> > > I already have it in sched/urgent.
> > 
> > Looks like this just missed 4.6-rc7 and the release email for
> > that doesn't suggest an rc8, as it stands...
> 
> But the final 4.6 will be released on Sunday or so and there are a few days left 
> still.

Yeah, I'll send the sched/urgent bits to Linus later today.

Thanks,

	Ingo

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

end of thread, other threads:[~2016-05-10  8:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-06 12:58 [PATCH] sched/fair: Invoke cpufreq hooks for CONFIG_SMP unset Rafael J. Wysocki
2016-05-06 19:08 ` Steve Muckle
2016-05-06 19:36   ` Rafael J. Wysocki
2016-05-07  6:13 ` Peter Zijlstra
2016-05-07  6:30   ` Ingo Molnar
2016-05-09  8:30     ` Peter Zijlstra
2016-05-09 23:53     ` Steve Muckle
2016-05-09 23:58       ` Rafael J. Wysocki
2016-05-10  8:13         ` Ingo Molnar
2016-05-07  6:37 ` [tip:sched/urgent] sched/fair: Fix !CONFIG_SMP kernel cpufreq governor breakage tip-bot for Rafael J. Wysocki

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.