linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Turquette <mturquette@linaro.org>
To: peterz@infradead.org, mingo@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	preeti@linux.vnet.ibm.com, Morten.Rasmussen@arm.com,
	riel@redhat.com, efault@gmx.de, nicolas.pitre@linaro.org,
	daniel.lezcano@linaro.org, dietmar.eggemann@arm.com,
	vincent.guittot@linaro.org, amit.kucheria@linaro.org,
	juri.lelli@arm.com, rjw@rjwysocki.net, viresh.kumar@linaro.org,
	ashwin.chaugule@linaro.org, alex.shi@linaro.org,
	abelvesa@gmail.com, Michael Turquette <mturquette@linaro.org>
Subject: [PATCH RFC v2 3/4] sched: expose capacity_of in sched.h
Date: Mon, 11 May 2015 19:13:14 -0700	[thread overview]
Message-ID: <1431396795-32439-4-git-send-email-mturquette@linaro.org> (raw)
In-Reply-To: <1431396795-32439-1-git-send-email-mturquette@linaro.org>

capacity_of is of use to a cpu frequency scaling policy based on cfs
load tracking and cpu capacity utilization metrics. Expose this call in
sched.h so it can be used in such a policy.

Signed-off-by: Michael Turquette <mturquette@linaro.org>
---
Changes in v2:
	Do not expose get_cpu_usage or capacity_orig_of in sched.h
	Expose capacity_of instead

 kernel/sched/fair.c  | 5 -----
 kernel/sched/sched.h | 5 +++++
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 75aec8d..d27ded9 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4361,11 +4361,6 @@ static unsigned long target_load(int cpu, int type)
 	return max(rq->cpu_load[type-1], total);
 }
 
-static unsigned long capacity_of(int cpu)
-{
-	return cpu_rq(cpu)->cpu_capacity;
-}
-
 static unsigned long capacity_orig_of(int cpu)
 {
 	return cpu_rq(cpu)->cpu_capacity_orig;
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index e0e1299..4925bc4 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1396,6 +1396,11 @@ unsigned long arch_scale_freq_capacity(struct sched_domain *sd, int cpu)
 }
 #endif
 
+static inline unsigned long capacity_of(int cpu)
+{
+	return cpu_rq(cpu)->cpu_capacity;
+}
+
 static inline void sched_rt_avg_update(struct rq *rq, u64 rt_delta)
 {
 	rq->rt_avg += rt_delta * arch_scale_freq_capacity(NULL, cpu_of(rq));
-- 
1.9.1

  parent reply	other threads:[~2015-05-12  2:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-12  2:13 [PATCH RFC v2 0/4] scheduler-driven cpu frequency selection Michael Turquette
2015-05-12  2:13 ` [PATCH RFC v2 1/4] arm: Frequency invariant scheduler load-tracking support Michael Turquette
2015-05-22 23:43   ` Rafael J. Wysocki
2015-05-12  2:13 ` [PATCH RFC v2 2/4] sched: sched feature for cpu frequency selection Michael Turquette
2015-05-12  2:13 ` Michael Turquette [this message]
2015-05-12  2:13 ` [PATCH RFC v2 4/4] sched: cpufreq_cfs: pelt-based cpu frequency scaling Michael Turquette
2015-05-13  9:19   ` Paul Bolle
2015-05-18 16:42   ` Juri Lelli
2015-06-29 16:51     ` Michael Turquette
2015-05-23  0:10   ` Rafael J. Wysocki
2015-06-10  6:23   ` Alex Shi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1431396795-32439-4-git-send-email-mturquette@linaro.org \
    --to=mturquette@linaro.org \
    --cc=Morten.Rasmussen@arm.com \
    --cc=abelvesa@gmail.com \
    --cc=alex.shi@linaro.org \
    --cc=amit.kucheria@linaro.org \
    --cc=ashwin.chaugule@linaro.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=dietmar.eggemann@arm.com \
    --cc=efault@gmx.de \
    --cc=juri.lelli@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=nicolas.pitre@linaro.org \
    --cc=peterz@infradead.org \
    --cc=preeti@linux.vnet.ibm.com \
    --cc=riel@redhat.com \
    --cc=rjw@rjwysocki.net \
    --cc=vincent.guittot@linaro.org \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).