From patchwork Wed Oct 22 06:07:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Turquette X-Patchwork-Id: 39251 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7C845202DB for ; Wed, 22 Oct 2014 06:08:05 +0000 (UTC) Received: by mail-wi0-f197.google.com with SMTP id fb4sf207980wid.4 for ; Tue, 21 Oct 2014 23:08:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=tiyMVfN8dyRulazs+G+ZtjbL6z/CcIqIO5pejbznAEg=; b=R70etShb1HTVa+KF9NxC/wWFNHkFuWIm75UXpRftRLvSmuPbkqpIMHTW6lnGIuFCWc zqdUe6QDalVnakZZRc8oCBd0w0oNtaq/iiugCs9ZyMCcLjBNqHbcZb6GEZZu0zQ485Sf 8/ww55hQ3YsCaBa41cdnAe85HnPz8l0VCf+aeC+JRPu/V3laQgsd+NWAlmSN80KGzrlL vEXfKCdpXfDEgpxBXVjdAJb9hYXM/0/dB8yxal1QGOFqY/GWw3FeGPHHBhsxkllD8ZMR O8N3T0183rytJfQss/2mwFAdZJq34CNRjGjZZ3KI66gR7Uvwt0SEh5RDkWy+ESrDVyMH A3hg== X-Gm-Message-State: ALoCoQn1jWvknd9ldtWxChCpARCb0jJWkDykpxpNNmzqdpo72MLaYLgw5H4i6qQ4HmjU+RabQGrE X-Received: by 10.181.27.135 with SMTP id jg7mr606835wid.5.1413958084437; Tue, 21 Oct 2014 23:08:04 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.107 with SMTP id kx11ls158930lac.80.gmail; Tue, 21 Oct 2014 23:08:04 -0700 (PDT) X-Received: by 10.152.36.230 with SMTP id t6mr735410laj.88.1413958083952; Tue, 21 Oct 2014 23:08:03 -0700 (PDT) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id sf5si21984286lbb.46.2014.10.21.23.08.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 Oct 2014 23:08:03 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by mail-lb0-f178.google.com with SMTP id w7so2250033lbi.37 for ; Tue, 21 Oct 2014 23:08:03 -0700 (PDT) X-Received: by 10.112.97.135 with SMTP id ea7mr39741254lbb.46.1413958083870; Tue, 21 Oct 2014 23:08:03 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.84.229 with SMTP id c5csp17735lbz; Tue, 21 Oct 2014 23:08:03 -0700 (PDT) X-Received: by 10.70.36.202 with SMTP id s10mr39598452pdj.101.1413958082382; Tue, 21 Oct 2014 23:08:02 -0700 (PDT) Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com. [209.85.220.47]) by mx.google.com with ESMTPS id rc17si13338424pab.100.2014.10.21.23.08.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 Oct 2014 23:08:02 -0700 (PDT) Received-SPF: pass (google.com: domain of mturquette@linaro.org designates 209.85.220.47 as permitted sender) client-ip=209.85.220.47; Received: by mail-pa0-f47.google.com with SMTP id kq14so3018015pab.20 for ; Tue, 21 Oct 2014 23:08:01 -0700 (PDT) X-Received: by 10.68.215.2 with SMTP id oe2mr40371548pbc.94.1413958081662; Tue, 21 Oct 2014 23:08:01 -0700 (PDT) Received: from quantum.home (pool-108-47-66-231.lsanca.fios.verizon.net. [108.47.66.231]) by mx.google.com with ESMTPSA id t1sm3836068pda.59.2014.10.21.23.07.59 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 Oct 2014 23:08:00 -0700 (PDT) From: Mike Turquette To: peterz@infradead.org, mingo@kernel.org Cc: linux-kernel@vger.kernel.org, preeti@linux.vnet.ibm.com, Morten.Rasmussen@arm.com, kamalesh@linux.vnet.ibm.com, riel@redhat.com, efault@gmx.de, nicolas.pitre@linaro.org, linaro-kernel@lists.linaro.org, daniel.lezcano@linaro.org, dietmar.eggemann@arm.com, pjt@google.com, bsegall@google.com, vincent.guittot@linaro.org, patches@linaro.org, tuukka.tikkanen@linaro.org, amit.kucheria@linaro.org, Mike Turquette Subject: [PATCH RFC 5/7] sched: cfs: cpu frequency scaling arch functions Date: Tue, 21 Oct 2014 23:07:29 -0700 Message-Id: <1413958051-7103-6-git-send-email-mturquette@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1413958051-7103-1-git-send-email-mturquette@linaro.org> References: <1413958051-7103-1-git-send-email-mturquette@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mturquette@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , arch_eval_cpu_freq and arch_scale_cpu_freq are added to allow the scheduler to evaluate if cpu frequency should change and to invoke that change from a safe context. They are weakly defined arch functions that do nothing by default. A CPUfreq governor could use these functions to implement a frequency scaling policy based on updates to per-task statistics or updates to per-cpu utilization. As discussed at Linux Plumbers Conference 2014, the goal will be to focus on a single cpu frequency scaling policy that works for everyone. That may mean that the weak arch functions definitions can be removed entirely and a single policy implements that logic for all architectures. Not-signed-off-by: Mike Turquette --- kernel/sched/fair.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 0930ad8..1af6f6d 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -2265,6 +2265,8 @@ static u32 __compute_runnable_contrib(u64 n) } unsigned long arch_scale_load_capacity(int cpu); +void arch_eval_cpu_freq(struct cpumask *cpus); +void arch_scale_cpu_freq(void); /* * We can represent the historical contribution to runnable average as the @@ -5805,6 +5807,16 @@ unsigned long __weak arch_scale_load_capacity(int cpu) return default_scale_load_capacity(cpu); } +void __weak arch_eval_cpu_freq(struct cpumask *cpus) +{ + return; +} + +void __weak arch_scale_cpu_freq(void) +{ + return; +} + static unsigned long scale_rt_capacity(int cpu) { struct rq *rq = cpu_rq(cpu);