aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuri Lelli <juri.lelli@arm.com>2015-11-10 12:40:43 +0000
committerJuri Lelli <juri.lelli@arm.com>2015-11-10 12:40:43 +0000
commitb9ed5586638749771886164255c3259dc48eb4a2 (patch)
tree9c000002f9f4daa437640e79c9d0fc3d31648e72
parentc7eef500a554601eb8cf61bc12a3cd01ee9c5e52 (diff)
downloadlinux-linaro-stable-b9ed5586638749771886164255c3259dc48eb4a2.tar.gz
kernel/sched: move cpu_capacity_orig outside CONFIG_SMP
cpu_capacity_orig might be used in !CONFIG_SMP configuration as well (e.g., when GOV_SCHED is compiled). Move it outside CONFIG_SMP boundaries. Signed-off-by: Juri Lelli <juri.lelli@arm.com>
-rw-r--r--kernel/sched/core.c3
-rw-r--r--kernel/sched/fair.c10
-rw-r--r--kernel/sched/sched.h2
3 files changed, 8 insertions, 7 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 1ebe8fccd32b..54cb1739b1a5 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -7292,7 +7292,7 @@ void __init sched_init(void)
#ifdef CONFIG_SMP
rq->sd = NULL;
rq->rd = NULL;
- rq->cpu_capacity = rq->cpu_capacity_orig = SCHED_CAPACITY_SCALE;
+ rq->cpu_capacity = SCHED_CAPACITY_SCALE;
rq->post_schedule = 0;
rq->active_balance = 0;
rq->next_balance = jiffies;
@@ -7313,6 +7313,7 @@ void __init sched_init(void)
rq->last_sched_tick = 0;
#endif
#endif
+ rq->cpu_capacity_orig = SCHED_CAPACITY_SCALE;
init_rq_hrtick(rq);
atomic_set(&rq->nr_iowait, 0);
}
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index ea4bc202a221..0058830c8f0b 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4233,6 +4233,11 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int flags)
hrtick_update(rq);
}
+unsigned long capacity_orig_of(int cpu)
+{
+ return cpu_rq(cpu)->cpu_capacity_orig;
+}
+
#ifdef CONFIG_SMP
/* Used instead of source_load when we know the type == 0 */
static unsigned long weighted_cpuload(const int cpu)
@@ -4278,11 +4283,6 @@ static unsigned long capacity_of(int cpu)
return cpu_rq(cpu)->cpu_capacity;
}
-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);
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 015f5c3e59e1..0d43a7255eb7 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -596,7 +596,6 @@ struct rq {
struct sched_domain *sd;
unsigned long cpu_capacity;
- unsigned long cpu_capacity_orig;
unsigned char idle_balance;
/* For active balancing */
@@ -618,6 +617,7 @@ struct rq {
/* This is used to determine avg_idle's max value */
u64 max_idle_balance_cost;
#endif
+ unsigned long cpu_capacity_orig;
#ifdef CONFIG_IRQ_TIME_ACCOUNTING
u64 prev_irq_time;