Skip to content

Commit 536bd00

Browse files
rafaeljwIngo Molnar
authored andcommitted
sched/fair: Fix !CONFIG_SMP kernel cpufreq governor breakage
The following commit: 34e2c55 ("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: 34e2c55 (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>
1 parent 2548d54 commit 536bd00

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

kernel/sched/fair.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3030,7 +3030,14 @@ static int idle_balance(struct rq *this_rq);
30303030

30313031
#else /* CONFIG_SMP */
30323032

3033-
static inline void update_load_avg(struct sched_entity *se, int update_tg) {}
3033+
static inline void update_load_avg(struct sched_entity *se, int not_used)
3034+
{
3035+
struct cfs_rq *cfs_rq = cfs_rq_of(se);
3036+
struct rq *rq = rq_of(cfs_rq);
3037+
3038+
cpufreq_trigger_update(rq_clock(rq));
3039+
}
3040+
30343041
static inline void
30353042
enqueue_entity_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se) {}
30363043
static inline void

0 commit comments

Comments
 (0)