From: Alex Shi <alex.shi@linaro.org>
To: mingo@redhat.com, peterz@infradead.org, morten.rasmussen@arm.com
Cc: vincent.guittot@linaro.org, daniel.lezcano@linaro.org,
fweisbec@gmail.com, linux@arm.linux.org.uk, tony.luck@intel.com,
fenghua.yu@intel.com, james.hogan@imgtec.com,
alex.shi@linaro.org, jason.low2@hp.com, viresh.kumar@linaro.org,
hanjun.guo@linaro.org, linux-kernel@vger.kernel.org,
tglx@linutronix.de, akpm@linux-foundation.org,
arjan@linux.intel.com, pjt@google.com, fengguang.wu@intel.com,
linaro-kernel@lists.linaro.org, wangyun@linux.vnet.ibm.com,
mgorman@suse.de
Subject: [PATCH 3/8] sched: remove source_load and target_load
Date: Thu, 13 Mar 2014 13:57:24 +0800 [thread overview]
Message-ID: <1394690249-14130-4-git-send-email-alex.shi@linaro.org> (raw)
In-Reply-To: <1394690249-14130-1-git-send-email-alex.shi@linaro.org>
We have no load_idx any more, so source/target_load always return the
same value as weighted_cpuload. So we can remove these 2 functions.
Signed-off-by: Alex Shi <alex.shi@linaro.org>
---
kernel/sched/fair.c | 54 +++++------------------------------------------------
1 file changed, 5 insertions(+), 49 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 4aee391..6469907 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1015,8 +1015,6 @@ bool should_numa_migrate_memory(struct task_struct *p, struct page * page,
}
static unsigned long weighted_cpuload(const int cpu);
-static unsigned long source_load(int cpu);
-static unsigned long target_load(int cpu);
static unsigned long power_of(int cpu);
static long effective_load(struct task_group *tg, int cpu, long wl, long wg);
@@ -3950,45 +3948,11 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int flags)
}
#ifdef CONFIG_SMP
-/* Used instead of source_load when we know the type == 0 */
static unsigned long weighted_cpuload(const int cpu)
{
return cpu_rq(cpu)->cfs.runnable_load_avg;
}
-/*
- * Return a low guess at the load of a migration-source cpu weighted
- * according to the scheduling class and "nice" value.
- *
- * We want to under-estimate the load of migration sources, to
- * balance conservatively.
- */
-static unsigned long source_load(int cpu)
-{
- struct rq *rq = cpu_rq(cpu);
- unsigned long total = weighted_cpuload(cpu);
-
- if (!sched_feat(LB_BIAS))
- return total;
-
- return min(rq->cpu_load, total);
-}
-
-/*
- * Return a high guess at the load of a migration-target cpu weighted
- * according to the scheduling class and "nice" value.
- */
-static unsigned long target_load(int cpu)
-{
- struct rq *rq = cpu_rq(cpu);
- unsigned long total = weighted_cpuload(cpu);
-
- if (!sched_feat(LB_BIAS))
- return total;
-
- return max(rq->cpu_load, total);
-}
-
static unsigned long power_of(int cpu)
{
return cpu_rq(cpu)->cpu_power;
@@ -4201,8 +4165,8 @@ static int wake_affine(struct sched_domain *sd, struct task_struct *p, int sync)
this_cpu = smp_processor_id();
prev_cpu = task_cpu(p);
- load = source_load(prev_cpu);
- this_load = target_load(this_cpu);
+ load = weighted_cpuload(prev_cpu);
+ this_load = weighted_cpuload(this_cpu);
/*
* If sync wakeup then subtract the (maximum possible)
@@ -4258,7 +4222,7 @@ static int wake_affine(struct sched_domain *sd, struct task_struct *p, int sync)
if (balanced ||
(this_load <= load &&
- this_load + target_load(prev_cpu) <= tl_per_task)) {
+ this_load + weighted_cpuload(prev_cpu) <= tl_per_task)) {
/*
* This domain has SD_WAKE_AFFINE and
* p is cache cold in this domain, and
@@ -4300,11 +4264,7 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p, int this_cpu)
avg_load = 0;
for_each_cpu(i, sched_group_cpus(group)) {
- /* Bias balancing toward cpus of our domain */
- if (local_group)
- load = source_load(i);
- else
- load = target_load(i);
+ load = weighted_cpuload(i);
avg_load += load;
}
@@ -5762,11 +5722,7 @@ static inline void update_sg_lb_stats(struct lb_env *env,
for_each_cpu_and(i, sched_group_cpus(group), env->cpus) {
struct rq *rq = cpu_rq(i);
- /* Bias balancing toward cpus of our domain */
- if (local_group)
- load = target_load(i);
- else
- load = source_load(i);
+ load = weighted_cpuload(i);
sgs->group_load += load;
sgs->sum_nr_running += rq->nr_running;
--
1.8.1.2
next prev parent reply other threads:[~2014-03-13 6:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-13 5:57 [ PATCH 0/8] sched: remove cpu_load array Alex Shi
2014-03-13 5:57 ` [PATCH 1/8] sched: shortcut to remove load_idx Alex Shi
2014-03-13 5:57 ` [PATCH 2/8] sched: remove rq->cpu_load[load_idx] array Alex Shi
2014-03-13 5:57 ` Alex Shi [this message]
2014-03-13 5:57 ` [PATCH 4/8] sched: remove LB_BIAS Alex Shi
2014-03-13 5:57 ` [PATCH 5/8] sched: clean up cpu_load update Alex Shi
2014-03-13 5:57 ` [PATCH 6/8] sched: rewrite update_cpu_load_nohz Alex Shi
2014-03-13 5:57 ` [PATCH 7/8] sched: remove rq->cpu_load and rq->nr_load_updates Alex Shi
2014-03-13 5:57 ` [PATCH 8/8] sched: rename update_*_cpu_load Alex Shi
2014-03-17 3:24 ` [ PATCH 0/8] sched: remove cpu_load array Alex Shi
2014-03-18 2:17 ` 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=1394690249-14130-4-git-send-email-alex.shi@linaro.org \
--to=alex.shi@linaro.org \
--cc=akpm@linux-foundation.org \
--cc=arjan@linux.intel.com \
--cc=daniel.lezcano@linaro.org \
--cc=fengguang.wu@intel.com \
--cc=fenghua.yu@intel.com \
--cc=fweisbec@gmail.com \
--cc=hanjun.guo@linaro.org \
--cc=james.hogan@imgtec.com \
--cc=jason.low2@hp.com \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=morten.rasmussen@arm.com \
--cc=peterz@infradead.org \
--cc=pjt@google.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=vincent.guittot@linaro.org \
--cc=viresh.kumar@linaro.org \
--cc=wangyun@linux.vnet.ibm.com \
/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
all inboxes | Powered by JetHome®