From patchwork Tue May 23 08:53:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juri Lelli X-Patchwork-Id: 100355 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp217305qge; Tue, 23 May 2017 01:54:39 -0700 (PDT) X-Received: by 10.84.218.71 with SMTP id f7mr34454943plm.135.1495529678948; Tue, 23 May 2017 01:54:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495529678; cv=none; d=google.com; s=arc-20160816; b=A4bSHnhgF2dvbjSIbUmzdPTh4ONy/GS3XO4+mFprOEyOk7F49rQ427m5rDko7dWjES NMT7kobqA8AMtudkgWCYBV8w8Eqdo8zWNY9wIEGX8feUludA1sGtuiw8wYL6+B/jhb/H t7Gp6X01vhEX+dsp9hWIxYM5egr7g2DGK1MYfk3Q44nGnwG3dyE6fzsGhpdb3p4vTdxG u78RyCCKtBtFMzg02Ag84qt7/D5AH6GK9VqTXoWlDXLCIIwjaqO9QnLc7B1EHFOi4Zun 0pd88RAI/HAvvYmbyXL6vR/2GCsu8tLnZTAednolmH5280BreYxP031FRrWPs7M6MUmF 3f1A== 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=2lwkKeQQqtLXf1bx904D3q/KEMo7/2lp/35iUnoB4r8=; b=0xzMj7paWZ4ocQgmUNQPedWil0kJwSwQis+ylxf3SXrjl8m/Bf+YY309hMTAzi08SO e6zza1uFvFql6ibapaXcOSRPxe96Lsw5BUdt5KIB3yFKxeljK1crsFt22Nc6d7p7IQmc me6KGQaNsQxgeZJt+a2dFQIQwe7IcKlfiu+gG272t0ijTWJR0uk8DTlvDcazdVv+WdoP QfzkFj4WzZVcN3MJNMB/VqpqznJm6WLmIyEnp9N2VOWrDBeoOCcQjz6TXaz2y7omuDwh QhZzf+8FheanqP3whawjOA2e+MUk5NrUKQP7LerYyyN1S3n1rnnVpgpjCfq/hl5+uDna zBpw== 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 r3si20536564plj.55.2017.05.23.01.54.38; Tue, 23 May 2017 01:54:38 -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 S936670AbdEWIyh (ORCPT + 14 others); Tue, 23 May 2017 04:54:37 -0400 Received: from foss.arm.com ([217.140.101.70]:48094 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936682AbdEWIyf (ORCPT ); Tue, 23 May 2017 04:54:35 -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 2B7C515A2; Tue, 23 May 2017 01:54:34 -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 88E873F53D; Tue, 23 May 2017 01:54:30 -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 2/8] sched/deadline: move cpu frequency selection triggering points Date: Tue, 23 May 2017 09:53:45 +0100 Message-Id: <20170523085351.18586-3-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 Since SCHED_DEADLINE doesn't track utilization signal (but reserves a fraction of CPU bandwidth to tasks admitted to the system), there is no point in evaluating frequency changes during each tick event. Move frequency selection triggering points to where running_bw changes. Co-authored-by: Claudio Scordino Signed-off-by: Juri Lelli Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Rafael J. Wysocki Cc: Viresh Kumar Cc: Luca Abeni --- kernel/sched/deadline.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.11.0 diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index 1da44b36fae0..fed54b078240 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -52,6 +52,8 @@ void add_running_bw(u64 dl_bw, struct dl_rq *dl_rq) dl_rq->running_bw += dl_bw; SCHED_WARN_ON(dl_rq->running_bw < old); /* overflow */ SCHED_WARN_ON(dl_rq->running_bw > dl_rq->this_bw); + /* kick cpufreq (see the comment in kernel/sched/sched.h). */ + cpufreq_update_this_cpu(rq_of_dl_rq(dl_rq), SCHED_CPUFREQ_DL); } static inline @@ -64,6 +66,8 @@ void sub_running_bw(u64 dl_bw, struct dl_rq *dl_rq) SCHED_WARN_ON(dl_rq->running_bw > old); /* underflow */ if (dl_rq->running_bw > old) dl_rq->running_bw = 0; + /* kick cpufreq (see the comment in kernel/sched/sched.h). */ + cpufreq_update_this_cpu(rq_of_dl_rq(dl_rq), SCHED_CPUFREQ_DL); } static inline @@ -1021,9 +1025,6 @@ static void update_curr_dl(struct rq *rq) return; } - /* kick cpufreq (see the comment in kernel/sched/sched.h). */ - cpufreq_update_this_cpu(rq, SCHED_CPUFREQ_DL); - schedstat_set(curr->se.statistics.exec_max, max(curr->se.statistics.exec_max, delta_exec));