aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2014-05-07 14:52:11 +0100
committerMark Brown <broonie@linaro.org>2014-05-07 14:52:11 +0100
commit970a8e6b53c2b79572187f9f816ad9617bed37e0 (patch)
treec9957d4b3ff5390d077e4f0ab577bb8ab89f9923
parent48dfbf3a9ea6c19e9290962b0a15fe25037456be (diff)
parent1ade57e54ea2257ccf753dbd54144769439c3c70 (diff)
Merge branch 'for-lsk' of git://git.linaro.org/arm/big.LITTLE/mp into lsk-v3.10-big.LITTLE
-rw-r--r--kernel/sched/fair.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 43857fec77be..ed976a4aa824 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3676,15 +3676,29 @@ unsigned int hmp_next_up_threshold = 4096;
unsigned int hmp_next_down_threshold = 4096;
#ifdef CONFIG_SCHED_HMP_LITTLE_PACKING
-#ifndef CONFIG_ARCH_VEXPRESS_TC2
+/*
+ * Set the default packing threshold to try to keep little
+ * CPUs at no more than 80% of their maximum frequency if only
+ * packing a small number of small tasks. Bigger tasks will
+ * raise frequency as normal.
+ * In order to pack a task onto a CPU, the sum of the
+ * unweighted runnable_avg load of existing tasks plus the
+ * load of the new task must be less than hmp_full_threshold.
+ *
+ * This works in conjunction with frequency-invariant load
+ * and DVFS governors. Since most DVFS governors aim for 80%
+ * utilisation, we arrive at (0.8*0.8*(max_load=1024))=655
+ * and use a value slightly lower to give a little headroom
+ * in the decision.
+ * Note that the most efficient frequency is different for
+ * each system so /sys/kernel/hmp/packing_limit should be
+ * configured at runtime for any given platform to achieve
+ * optimal energy usage. Some systems may not benefit from
+ * packing, so this feature can also be disabled at runtime
+ * with /sys/kernel/hmp/packing_enable
+ */
unsigned int hmp_packing_enabled = 1;
-unsigned int hmp_full_threshold = (NICE_0_LOAD * 9) / 8;
-#else
-/* TC2 has a sharp consumption curve @ around 800Mhz, so
- we aim to spread the load around that frequency. */
-unsigned int hmp_packing_enabled;
-unsigned int hmp_full_threshold = 650; /* 80% of the 800Mhz freq * NICE_0_LOAD */
-#endif
+unsigned int hmp_full_threshold = 650;
#endif
static unsigned int hmp_up_migration(int cpu, int *target_cpu, struct sched_entity *se);
@@ -3780,8 +3794,8 @@ static inline unsigned int hmp_select_slower_cpu(struct task_struct *tsk,
* Select the 'best' candidate little CPU to wake up on.
* Implements a packing strategy which examines CPU in
* logical CPU order, and selects the first which will
- * have at least 10% capacity available, according to
- * both tracked load of the runqueue and the task.
+ * be loaded less than hmp_full_threshold according to
+ * the sum of the tracked load of the runqueue and the task.
*/
static inline unsigned int hmp_best_little_cpu(struct task_struct *tsk,
int cpu) {