aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Redpath <chris.redpath@arm.com>2014-05-06 19:46:50 +0100
committerJon Medhurst <tixy@linaro.org>2014-05-07 11:34:00 +0100
commit1ade57e54ea2257ccf753dbd54144769439c3c70 (patch)
tree6e9a60b74d735289fd1172068f70c4ad97401218
parentdb3dba6818796b90053d5b1bc9f15837acdc9b9c (diff)
sched: hmp: Change small task packing defaults for all platforms
All platforms other than TC2 default to enabling packing. Since TC2 shows no performance or energy degradation with this feature enabled make it default enabled the same as everyone else. Likewise, vendors have been including TC2 support in multi-machine kernel builds so they expect the default thresholds to remain the same when the TC2 #ifdef is removed. Signed-off-by: Chris Redpath <chris.redpath@arm.com> Signed-off-by: Jon Medhurst <tixy@linaro.org>
-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 43857fec77b..ed976a4aa82 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) {