From: tip-bot for Vincent Guittot <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: hpa@zytor.com, morten.rasmussen@arm.com, tglx@linutronix.de,
peterz@infradead.org, kamalesh@linux.vnet.ibm.com,
mingo@kernel.org, linux-kernel@vger.kernel.org,
vincent.guittot@linaro.org
Subject: [tip:sched/core] sched: Add struct rq::cpu_capacity_orig
Date: Fri, 27 Mar 2015 04:41:28 -0700 [thread overview]
Message-ID: <tip-ca6d75e6908efbc350d536e0b496ebdac36b20d2@git.kernel.org> (raw)
In-Reply-To: <1425052454-25797-7-git-send-email-vincent.guittot@linaro.org>
Commit-ID: ca6d75e6908efbc350d536e0b496ebdac36b20d2
Gitweb: http://git.kernel.org/tip/ca6d75e6908efbc350d536e0b496ebdac36b20d2
Author: Vincent Guittot <vincent.guittot@linaro.org>
AuthorDate: Fri, 27 Feb 2015 16:54:09 +0100
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 27 Mar 2015 09:36:02 +0100
sched: Add struct rq::cpu_capacity_orig
This new field 'cpu_capacity_orig' reflects the original capacity of a CPU
before being altered by rt tasks and/or IRQ
The cpu_capacity_orig will be used:
- to detect when the capacity of a CPU has been noticeably reduced so we can
trig load balance to look for a CPU with better capacity. As an example, we
can detect when a CPU handles a significant amount of irq
(with CONFIG_IRQ_TIME_ACCOUNTING) but this CPU is seen as an idle CPU by
scheduler whereas CPUs, which are really idle, are available.
- evaluate the available capacity for CFS tasks
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Acked-by: Morten Rasmussen <morten.rasmussen@arm.com>
Cc: Morten.Rasmussen@arm.com
Cc: dietmar.eggemann@arm.com
Cc: efault@gmx.de
Cc: linaro-kernel@lists.linaro.org
Cc: nicolas.pitre@linaro.org
Cc: preeti@linux.vnet.ibm.com
Cc: riel@redhat.com
Link: http://lkml.kernel.org/r/1425052454-25797-7-git-send-email-vincent.guittot@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/sched/core.c | 2 +-
kernel/sched/fair.c | 8 +++++++-
kernel/sched/sched.h | 1 +
3 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index feda520..7022e90 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -7216,7 +7216,7 @@ void __init sched_init(void)
#ifdef CONFIG_SMP
rq->sd = NULL;
rq->rd = NULL;
- rq->cpu_capacity = SCHED_CAPACITY_SCALE;
+ rq->cpu_capacity = rq->cpu_capacity_orig = SCHED_CAPACITY_SCALE;
rq->post_schedule = 0;
rq->active_balance = 0;
rq->next_balance = jiffies;
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index dc7c693..10f84c3 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4363,6 +4363,11 @@ 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;
+}
+
static unsigned long cpu_avg_load_per_task(int cpu)
{
struct rq *rq = cpu_rq(cpu);
@@ -6040,6 +6045,7 @@ static void update_cpu_capacity(struct sched_domain *sd, int cpu)
capacity >>= SCHED_CAPACITY_SHIFT;
+ cpu_rq(cpu)->cpu_capacity_orig = capacity;
sdg->sgc->capacity_orig = capacity;
capacity *= scale_rt_capacity(cpu);
@@ -6094,7 +6100,7 @@ void update_group_capacity(struct sched_domain *sd, int cpu)
* Runtime updates will correct capacity_orig.
*/
if (unlikely(!rq->sd)) {
- capacity_orig += capacity_of(cpu);
+ capacity_orig += capacity_orig_of(cpu);
capacity += capacity_of(cpu);
continue;
}
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 3600002..be56dfd 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -615,6 +615,7 @@ struct rq {
struct sched_domain *sd;
unsigned long cpu_capacity;
+ unsigned long cpu_capacity_orig;
unsigned char idle_balance;
/* For active balancing */
next prev parent reply other threads:[~2015-03-27 11:42 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-27 15:54 [PATCH v10 00/11] sched: consolidation of CPU capacity and usage Vincent Guittot
2015-02-27 15:54 ` [PATCH v10 01/11] sched: add utilization_avg_contrib Vincent Guittot
2015-03-27 11:40 ` [tip:sched/core] sched: Add sched_avg::utilization_avg_contrib tip-bot for Vincent Guittot
2015-02-27 15:54 ` [PATCH v10 02/11] sched: Track group sched_entity usage contributions Vincent Guittot
2015-03-27 11:40 ` [tip:sched/core] " tip-bot for Morten Rasmussen
2015-02-27 15:54 ` [PATCH v10 03/11] sched: remove frequency scaling from cpu_capacity Vincent Guittot
2015-03-27 11:40 ` [tip:sched/core] sched: Remove " tip-bot for Vincent Guittot
2015-02-27 15:54 ` [PATCH v10 04/11] sched: Make sched entity usage tracking scale-invariant Vincent Guittot
2015-03-03 12:51 ` Dietmar Eggemann
2015-03-04 7:54 ` Vincent Guittot
2015-03-04 7:46 ` Vincent Guittot
2015-03-27 11:40 ` [tip:sched/core] " tip-bot for Morten Rasmussen
2015-03-23 13:19 ` [PATCH v10 04/11] " Peter Zijlstra
2015-03-24 10:00 ` Vincent Guittot
2015-03-25 17:33 ` Peter Zijlstra
2015-03-25 18:08 ` Vincent Guittot
2015-03-26 17:38 ` Morten Rasmussen
2015-03-26 17:40 ` Morten Rasmussen
2015-03-26 17:46 ` [PATCH 1/2] sched: Change arch_scale_*() functions to scale input factor Morten Rasmussen
2015-03-26 17:46 ` [PATCH 2/2] sched: Make sched entity usage tracking scale-invariant Morten Rasmussen
2015-03-26 17:47 ` [PATCH v10 04/11] " Peter Zijlstra
2015-03-26 17:51 ` Morten Rasmussen
2015-03-27 8:17 ` Vincent Guittot
2015-03-27 9:05 ` Vincent Guittot
2015-04-02 16:53 ` Morten Rasmussen
2015-04-02 17:32 ` Peter Zijlstra
2015-04-07 13:31 ` Morten Rasmussen
2015-03-27 11:43 ` [tip:sched/core] sched: Optimize freq invariant accounting tip-bot for Peter Zijlstra
2015-02-27 15:54 ` [PATCH v10 05/11] sched: make scale_rt invariant with frequency Vincent Guittot
2015-03-27 11:41 ` [tip:sched/core] sched: Make " tip-bot for Vincent Guittot
2015-02-27 15:54 ` [PATCH v10 06/11] sched: add per rq cpu_capacity_orig Vincent Guittot
2015-03-27 11:41 ` tip-bot for Vincent Guittot [this message]
2015-02-27 15:54 ` [PATCH v10 07/11] sched: get CPU's usage statistic Vincent Guittot
2015-03-03 12:47 ` Dietmar Eggemann
2015-03-04 7:53 ` Vincent Guittot
2015-03-04 7:48 ` Vincent Guittot
2015-03-27 11:41 ` [tip:sched/core] sched: Calculate CPU' s usage statistic and put it into struct sg_lb_stats::group_usage tip-bot for Vincent Guittot
2015-03-27 15:12 ` [PATCH v10 07/11] sched: get CPU's usage statistic Xunlei Pang
2015-03-27 15:37 ` Vincent Guittot
2015-04-01 3:22 ` Xunlei Pang
2015-02-27 15:54 ` [PATCH v10 08/11] sched: replace capacity_factor by usage Vincent Guittot
2015-03-27 11:42 ` [tip:sched/core] sched: Replace " tip-bot for Vincent Guittot
2015-03-27 14:52 ` [PATCH v10 08/11] sched: replace " Xunlei Pang
2015-03-27 15:59 ` Vincent Guittot
2015-04-01 3:37 ` Xunlei Pang
2015-04-01 9:06 ` Vincent Guittot
2015-04-01 14:54 ` Xunlei Pang
2015-04-01 15:57 ` Vincent Guittot
2015-02-27 15:54 ` [PATCH v10 09/11] sched; remove unused capacity_orig from Vincent Guittot
2015-03-03 10:18 ` Morten Rasmussen
2015-03-03 10:33 ` Vincent Guittot
2015-03-03 10:35 ` [PATCH v10 09/11] sched; remove unused capacity_orig Vincent Guittot
2015-03-27 11:42 ` [tip:sched/core] sched: Remove unused struct sched_group_capacity ::capacity_orig tip-bot for Vincent Guittot
2015-02-27 15:54 ` [PATCH v10 10/11] sched: add SD_PREFER_SIBLING for SMT level Vincent Guittot
2015-03-02 11:52 ` Srikar Dronamraju
2015-03-03 8:38 ` Vincent Guittot
2015-03-23 9:11 ` Peter Zijlstra
2015-03-23 9:59 ` Preeti U Murthy
2015-03-26 10:55 ` Peter Zijlstra
2015-03-26 12:03 ` Preeti U Murthy
2015-03-27 11:42 ` [tip:sched/core] sched: Add " tip-bot for Vincent Guittot
2015-02-27 15:54 ` [PATCH v10 11/11] sched: move cfs task on a CPU with higher capacity Vincent Guittot
2015-03-26 14:19 ` Dietmar Eggemann
2015-03-26 15:43 ` Vincent Guittot
2015-03-27 11:42 ` [tip:sched/core] sched: Move CFS tasks to CPUs " tip-bot for Vincent Guittot
2015-03-11 10:10 ` [PATCH v10 00/11] sched: consolidation of CPU capacity and usage Vincent Guittot
2015-04-02 1:47 ` Wanpeng Li
2015-04-02 7:30 ` Vincent Guittot
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=tip-ca6d75e6908efbc350d536e0b496ebdac36b20d2@git.kernel.org \
--to=tipbot@zytor.com \
--cc=hpa@zytor.com \
--cc=kamalesh@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=morten.rasmussen@arm.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=vincent.guittot@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
Powered by JetHome