From patchwork Tue May 23 08:53:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juri Lelli X-Patchwork-Id: 100357 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp217390qge; Tue, 23 May 2017 01:54:57 -0700 (PDT) X-Received: by 10.98.32.18 with SMTP id g18mr30870582pfg.153.1495529697106; Tue, 23 May 2017 01:54:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495529697; cv=none; d=google.com; s=arc-20160816; b=jkWFKe1ATD/9rntsS9KsKptNHLREXvTTDasg3p2DfEy+2XRzErm462THpfzZ58sNdi uuPd3rw7I5KBQeQPrSBTlSMQO1HskhUWciIDUDcnRkrMTFWK8aI/8g99ak6GDkV70c6o /BN3s3GuxWgT0BzhlWmdhKm9lcX3RnTtyfiDjlAGWRQX3YgsCUrpSV5XVVfDFgbbFlJP jzaw7Djf7wJd56HfRs91kXlMUuzfvUg/q6wY6sWqiMGjv8O1vbL41UCPQBYlKB3RKt92 haZBp3qfEWOg6eUajPIENx+SBOKInYXYhgvdepGKIm8Xw/ccOBXBfkT/uBAFN25CYTJR ndJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=tPrg55gd5thIhOGgou0aWFy+oxRODVx0oDxSQdVC5Ms=; b=UsBjMvjoDu6wrGDzfHs0NiRkF7fMygMvyqC3mXj/4wQCvpRwd2GBuxpP6e0gT7qPvb pQvRAr+F4GG4AA7kuR0/rK0HzgiGvgk9JXAbb/rKNzKXZMZJHKRBEeANN0DTVEnCBOPq dq2UQx8PYvueCRsGh75axeJMnFBMRmhS7gO97lZJOnOPIeTxFdP5iIMFSYZOCK8hWiFK n1fOT4IGguMumrfJTK0tYM9qQ0j72Qro8ld+KLD0045zpHxJymxvTXvcVF3kuK9q5Mb8 1JaKKhyyIIGiPYiJX00zGi7XNansWS5skJXhGsdC+AohAMdilgWnZHC+8AVyS/Izw8LV ZZYA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c19si20093703pgk.90.2017.05.23.01.54.56; Tue, 23 May 2017 01:54:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967028AbdEWIyt (ORCPT + 14 others); Tue, 23 May 2017 04:54:49 -0400 Received: from foss.arm.com ([217.140.101.70]:48196 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967029AbdEWIyq (ORCPT ); Tue, 23 May 2017 04:54:46 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D7278165C; Tue, 23 May 2017 01:54:45 -0700 (PDT) Received: from cam-smtp0.cambridge.arm.com (e106622-lin.cambridge.arm.com [10.1.211.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3F0243F53D; Tue, 23 May 2017 01:54:42 -0700 (PDT) From: Juri Lelli To: peterz@infradead.org, mingo@redhat.com, rjw@rjwysocki.net, viresh.kumar@linaro.org Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, tglx@linutronix.de, vincent.guittot@linaro.org, rostedt@goodmis.org, luca.abeni@santannapisa.it, claudio@evidence.eu.com, tommaso.cucinotta@santannapisa.it, bristot@redhat.com, mathieu.poirier@linaro.org, tkjos@android.com, joelaf@google.com, andresoportus@google.com, morten.rasmussen@arm.com, dietmar.eggemann@arm.com, patrick.bellasi@arm.com, juri.lelli@arm.com, Ingo Molnar , "Rafael J . Wysocki" Subject: [PATCH RFC 5/8] sched/cpufreq_schedutil: always consider all CPUs when deciding next freq Date: Tue, 23 May 2017 09:53:48 +0100 Message-Id: <20170523085351.18586-6-juri.lelli@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170523085351.18586-1-juri.lelli@arm.com> References: <20170523085351.18586-1-juri.lelli@arm.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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 Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Rafael J. Wysocki Cc: Viresh Kumar Cc: Luca Abeni Cc: Claudio Scordino --- Changes from RFD - discard CFS contribution only as stale (as suggested by Rafael) --- kernel/sched/cpufreq_schedutil.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) -- 2.11.0 diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index f930cec4c3d4..688bd11c2641 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -259,17 +259,22 @@ 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; - 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;