[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1413958051-7103-3-git-send-email-mturquette@linaro.org>
Date: Tue, 21 Oct 2014 23:07:26 -0700
From: Mike Turquette <mturquette@...aro.org>
To: peterz@...radead.org, mingo@...nel.org
Cc: linux-kernel@...r.kernel.org, preeti@...ux.vnet.ibm.com,
Morten.Rasmussen@....com, kamalesh@...ux.vnet.ibm.com,
riel@...hat.com, efault@....de, nicolas.pitre@...aro.org,
linaro-kernel@...ts.linaro.org, daniel.lezcano@...aro.org,
dietmar.eggemann@....com, pjt@...gle.com, bsegall@...gle.com,
vincent.guittot@...aro.org, patches@...aro.org,
tuukka.tikkanen@...aro.org, amit.kucheria@...aro.org,
Mike Turquette <mturquette@...aro.org>
Subject: [PATCH RFC 2/7] sched: cfs: declare capacity_of in sched.h
capacity_of is useful for cpu frequency scaling policies. Share it via
sched.h so that selectable cpu frequency scaling policies can make use
of it.
Signed-off-by: Mike Turquette <mturquette@...aro.org>
---
kernel/sched/fair.c | 7 +++++--
kernel/sched/sched.h | 2 ++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 90b36cc..15f5638 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1018,7 +1018,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, int type);
static unsigned long target_load(int cpu, int type);
-static unsigned long capacity_of(int cpu);
static long effective_load(struct task_group *tg, int cpu, long wl, long wg);
/* Cached statistics for all CPUs within a node */
@@ -2056,6 +2055,10 @@ static inline void account_numa_dequeue(struct rq *rq, struct task_struct *p)
}
#endif /* CONFIG_NUMA_BALANCING */
+#ifdef CONFIG_SMP
+unsigned long capacity_of(int cpu);
+#endif /* CONFIG_SMP */
+
static void
account_entity_enqueue(struct cfs_rq *cfs_rq, struct sched_entity *se)
{
@@ -4132,7 +4135,7 @@ static unsigned long target_load(int cpu, int type)
return max(rq->cpu_load[type-1], total);
}
-static unsigned long capacity_of(int cpu)
+unsigned long capacity_of(int cpu)
{
return cpu_rq(cpu)->cpu_capacity;
}
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 04940f8..9a28d38 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -309,6 +309,8 @@ struct cfs_bandwidth { };
#endif /* CONFIG_CGROUP_SCHED */
+extern unsigned long capacity_of(int cpu);
+
/* CFS-related fields in a runqueue */
struct cfs_rq {
struct load_weight load;
--
1.8.3.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists