Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755625AbeAJMX7 (ORCPT + 1 other); Wed, 10 Jan 2018 07:23:59 -0500 Received: from terminus.zytor.com ([65.50.211.136]:55411 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752770AbeAJMX5 (ORCPT ); Wed, 10 Jan 2018 07:23:57 -0500 Date: Wed, 10 Jan 2018 04:19:31 -0800 From: tip-bot for Juri Lelli Message-ID: Cc: mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, juri.lelli@arm.com, tglx@linutronix.de, luca.abeni@santannapisa.it, torvalds@linux-foundation.org, claudio@evidence.eu.com, peterz@infradead.org, rafael.j.wysocki@intel.com, viresh.kumar@linaro.org Reply-To: peterz@infradead.org, claudio@evidence.eu.com, viresh.kumar@linaro.org, rafael.j.wysocki@intel.com, mingo@kernel.org, tglx@linutronix.de, juri.lelli@arm.com, hpa@zytor.com, linux-kernel@vger.kernel.org, luca.abeni@santannapisa.it, torvalds@linux-foundation.org In-Reply-To: <20171204102325.5110-6-juri.lelli@redhat.com> References: <20171204102325.5110-6-juri.lelli@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] sched/cpufreq: Always consider all CPUs when deciding next freq Git-Commit-ID: 0fa7d181f1a60149061632266bb432b4b61acdac X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Commit-ID: 0fa7d181f1a60149061632266bb432b4b61acdac Gitweb: https://git.kernel.org/tip/0fa7d181f1a60149061632266bb432b4b61acdac Author: Juri Lelli AuthorDate: Mon, 4 Dec 2017 11:23:22 +0100 Committer: Ingo Molnar CommitDate: Wed, 10 Jan 2018 12:53:34 +0100 sched/cpufreq: Always consider all CPUs when deciding next freq No assumption can be made upon the rate at which frequency updates get triggered, as there are scheduling policies (like SCHED_DEADLINE) which don't trigger them so frequently. Remove such assumption from the code, by always considering SCHED_DEADLINE utilization signal as not stale. Signed-off-by: Juri Lelli Signed-off-by: Peter Zijlstra (Intel) Acked-by: Viresh Kumar Cc: Claudio Scordino Cc: Linus Torvalds Cc: Luca Abeni Cc: Peter Zijlstra Cc: Rafael J . Wysocki Cc: Thomas Gleixner Cc: alessio.balsini@arm.com Cc: bristot@redhat.com Cc: dietmar.eggemann@arm.com Cc: joelaf@google.com Cc: juri.lelli@redhat.com Cc: mathieu.poirier@linaro.org Cc: morten.rasmussen@arm.com Cc: patrick.bellasi@arm.com Cc: rjw@rjwysocki.net Cc: rostedt@goodmis.org Cc: tkjos@android.com Cc: tommaso.cucinotta@santannapisa.it Cc: vincent.guittot@linaro.org Link: http://lkml.kernel.org/r/20171204102325.5110-6-juri.lelli@redhat.com Signed-off-by: Ingo Molnar --- kernel/sched/cpufreq_schedutil.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index e9e0713..dd062a1 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -315,17 +315,21 @@ static unsigned int sugov_next_freq_shared(struct sugov_cpu *sg_cpu, u64 time) s64 delta_ns; /* - * If the CPU utilization was last updated before the previous - * frequency update and the time elapsed between the last update - * of the CPU utilization and the last frequency update is long - * enough, don't take the CPU into account as it probably is - * idle now (and clear iowait_boost for it). + * If the CFS CPU utilization was last updated before the + * previous frequency update and the time elapsed between the + * last update of the CPU utilization and the last frequency + * update is long enough, reset iowait_boost and util_cfs, as + * they are now probably stale. However, still consider the + * CPU contribution if it has some DEADLINE utilization + * (util_dl). */ delta_ns = time - j_sg_cpu->last_update; if (delta_ns > TICK_NSEC) { j_sg_cpu->iowait_boost = 0; j_sg_cpu->iowait_boost_pending = false; - continue; + j_sg_cpu->util_cfs = 0; + if (j_sg_cpu->util_dl == 0) + continue; } if (j_sg_cpu->flags & SCHED_CPUFREQ_RT) return policy->cpuinfo.max_freq;