aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched/fair.c
diff options
context:
space:
mode:
authorNicolas Pitre <nicolas.pitre@linaro.org>2014-05-26 18:19:34 -0400
committerIngo Molnar <mingo@kernel.org>2014-06-05 05:52:14 -0400
commit5ef20ca181ec592e4684a45f4d5f1385f6055534 (patch)
tree4a5245325991a354441d21d7f64eb2c9c051f0a0 /kernel/sched/fair.c
parentfa93384f40deeb294fd29f2fdcadbd0ebc2dedf1 (diff)
sched/fair: Remove "power" from 'struct numa_stats'
It is better not to think about compute capacity as being equivalent to "CPU power". The upcoming "power aware" scheduler work may create confusion with the notion of energy consumption if "power" is used too liberally. To make things explicit and not create more confusion with the existing "capacity" member, let's rename things as follows: power -> compute_capacity capacity -> task_capacity Note: none of those fields are actually used outside update_numa_stats(). Signed-off-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: Vincent Guittot <vincent.guittot@linaro.org> Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Cc: Morten Rasmussen <morten.rasmussen@arm.com> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> Cc: linaro-kernel@lists.linaro.org Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: linux-kernel@vger.kernel.org Link: http://lkml.kernel.org/n/tip-2e2ndymj5gyshyjq8am79f20@git.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched/fair.c')
-rw-r--r--kernel/sched/fair.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index c63dde984956..1cfe5a25086d 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1026,10 +1026,10 @@ struct numa_stats {
1026 unsigned long load; 1026 unsigned long load;
1027 1027
1028 /* Total compute capacity of CPUs on a node */ 1028 /* Total compute capacity of CPUs on a node */
1029 unsigned long power; 1029 unsigned long compute_capacity;
1030 1030
1031 /* Approximate capacity in terms of runnable tasks on a node */ 1031 /* Approximate capacity in terms of runnable tasks on a node */
1032 unsigned long capacity; 1032 unsigned long task_capacity;
1033 int has_capacity; 1033 int has_capacity;
1034}; 1034};
1035 1035
@@ -1046,7 +1046,7 @@ static void update_numa_stats(struct numa_stats *ns, int nid)
1046 1046
1047 ns->nr_running += rq->nr_running; 1047 ns->nr_running += rq->nr_running;
1048 ns->load += weighted_cpuload(cpu); 1048 ns->load += weighted_cpuload(cpu);
1049 ns->power += power_of(cpu); 1049 ns->compute_capacity += power_of(cpu);
1050 1050
1051 cpus++; 1051 cpus++;
1052 } 1052 }
@@ -1062,9 +1062,10 @@ static void update_numa_stats(struct numa_stats *ns, int nid)
1062 if (!cpus) 1062 if (!cpus)
1063 return; 1063 return;
1064 1064
1065 ns->load = (ns->load * SCHED_POWER_SCALE) / ns->power; 1065 ns->load = (ns->load * SCHED_POWER_SCALE) / ns->compute_capacity;
1066 ns->capacity = DIV_ROUND_CLOSEST(ns->power, SCHED_POWER_SCALE); 1066 ns->task_capacity =
1067 ns->has_capacity = (ns->nr_running < ns->capacity); 1067 DIV_ROUND_CLOSEST(ns->compute_capacity, SCHED_POWER_SCALE);
1068 ns->has_capacity = (ns->nr_running < ns->task_capacity);
1068} 1069}
1069 1070
1070struct task_numa_env { 1071struct task_numa_env {