From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758541AbcEFMzc (ORCPT ); Fri, 6 May 2016 08:55:32 -0400 Received: from cloudserver094114.home.net.pl ([79.96.170.134]:63255 "HELO cloudserver094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751997AbcEFMza (ORCPT ); Fri, 6 May 2016 08:55:30 -0400 From: "Rafael J. Wysocki" To: Peter Zijlstra Cc: Linux PM list , Linux Kernel Mailing List , Viresh Kumar , Srinivas Pandruvada , Steve Muckle , Ingo Molnar Subject: [PATCH] sched/fair: Invoke cpufreq hooks for CONFIG_SMP unset Date: Fri, 06 May 2016 14:58:43 +0200 Message-ID: <6282396.VVEdgVYxO3@vostro.rjw.lan> User-Agent: KMail/4.11.5 (Linux/4.5.0-rc1+; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki 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 Signed-off-by: Rafael J. Wysocki --- 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