diff mbox

cpufreq governors broken with !CONFIG_SMP?

Message ID 1953902.drhraqW2It@vostro.rjw.lan (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Rafael J. Wysocki May 6, 2016, 12:25 a.m. UTC
On Friday, May 06, 2016 02:09:07 AM Rafael J. Wysocki wrote:
> On Thursday, May 05, 2016 04:49:22 PM Steve Muckle wrote:
> > While working on a few patches for schedutil I noticed that the CFS
> > cpufreq hooks depend on PELT, which depends on CONFIG_SMP.
> > 
> > I compiled and ran a UP kernel with intel_pstate. Running a cpu-bound
> > task did not result in the frequency increasing beyond fmin. For some reason
> > ondemand is working for me with the same test, not sure why yet.
> > 
> > It appears dbs/intel-pstate/schedutil have a dependency on CONFIG_SMP
> > now. Or am I missing something?
> 
> You're right AFAICS.
> 
> For governors other than schedutil fixing that would be a matter of
> adding a !CONFIG_SMP variant of update_load_avg() that will call
> cpufreq_update_util() and do nothing else.  It doesn't matter what
> is passed via util and max then.

Maybe something like the below, FWIW, as a quick fix for 4.6?

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


--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Peter Zijlstra May 6, 2016, 11:46 a.m. UTC | #1
On Fri, May 06, 2016 at 02:25:16AM +0200, Rafael J. Wysocki wrote:
> On Friday, May 06, 2016 02:09:07 AM Rafael J. Wysocki wrote:
> > On Thursday, May 05, 2016 04:49:22 PM Steve Muckle wrote:
> > > While working on a few patches for schedutil I noticed that the CFS
> > > cpufreq hooks depend on PELT, which depends on CONFIG_SMP.

> > For governors other than schedutil fixing that would be a matter of
> > adding a !CONFIG_SMP variant of update_load_avg() that will call
> > cpufreq_update_util() and do nothing else.  It doesn't matter what
> > is passed via util and max then.
> 
> Maybe something like the below, FWIW, as a quick fix for 4.6?

Right; I suppose that'll have to do for 4.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
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rafael J. Wysocki May 6, 2016, 11:49 a.m. UTC | #2
On Fri, May 6, 2016 at 1:46 PM, Peter Zijlstra <peterz@infradead.org> wrote:
> On Fri, May 06, 2016 at 02:25:16AM +0200, Rafael J. Wysocki wrote:
>> On Friday, May 06, 2016 02:09:07 AM Rafael J. Wysocki wrote:
>> > On Thursday, May 05, 2016 04:49:22 PM Steve Muckle wrote:
>> > > While working on a few patches for schedutil I noticed that the CFS
>> > > cpufreq hooks depend on PELT, which depends on CONFIG_SMP.
>
>> > For governors other than schedutil fixing that would be a matter of
>> > adding a !CONFIG_SMP variant of update_load_avg() that will call
>> > cpufreq_update_util() and do nothing else.  It doesn't matter what
>> > is passed via util and max then.
>>
>> Maybe something like the below, FWIW, as a quick fix for 4.6?
>
> Right; I suppose that'll have to do for 4.6.

OK, thanks!

I'll resend it with a changelog and stuff then.
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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