diff options
author | Vincent Guittot <vincent.guittot@linaro.org> | 2014-12-16 15:46:31 +0100 |
---|---|---|
committer | Vincent Guittot <vincent.guittot@linaro.org> | 2015-04-08 13:13:09 +0200 |
commit | c043b73e6cd6659a4f776598f1479df0ec36284d (patch) | |
tree | df760bed3790fce01631144dccf8f1db417888d1 /arch/arm/kernel | |
parent | 8c217604ee8bd1cbbce2a5b7a6788904e5e33b2d (diff) |
sched: packing tasks
Try to minimize the number of CPUs that are used to handle the current
activity.
You can set a packing threshold for each CPUs and clusters to define above
which level you should use more CPUs
You can also set a performance threshold to define above which level, you
should use a more performant CPU
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r-- | arch/arm/kernel/topology.c | 50 |
1 files changed, 47 insertions, 3 deletions
diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c index 08b7847bf912..8d9080a8a7fd 100644 --- a/arch/arm/kernel/topology.c +++ b/arch/arm/kernel/topology.c @@ -280,12 +280,56 @@ static inline int cpu_corepower_flags(void) return SD_SHARE_PKG_RESOURCES | SD_SHARE_POWERDOMAIN; } +/* + * power threshold should be filled according to platform info that can come + * from DT as an example. For now use default table + */ +static int core_pack_threshold[8][2] = { + /* pack, perf */ + { 50, 100}, + { 50, 100}, + { 50, 100}, + { 50, 100}, + { 40, 100}, + { 20, 100}, + { 20, 100}, + { 10, 100}, +}; + +static int cpu_core_th(int cpu, int index) +{ + if (cpu < 8) + return (core_pack_threshold[cpu][index] * 1024) / 100 ; + + return 0; +} + +static int cluster_pack_threshold[8][2] = { + /* pack, perf */ + { 0, 100}, + { 0, 100}, + { 0, 100}, + { 0, 100}, + { 40, 60}, + { 40, 60}, + { 40, 60}, + { 40, 60}, +}; + +static int cpu_cluster_th(int cpu, int index) +{ + if (cpu < 8) + return (cluster_pack_threshold[cpu][index] * 1024) / 100; + + return 0; +} + static struct sched_domain_topology_level arm_topology[] = { #ifdef CONFIG_SCHED_MC - { cpu_corepower_mask, cpu_corepower_flags, SD_INIT_NAME(GMC) }, - { cpu_coregroup_mask, cpu_core_flags, SD_INIT_NAME(MC) }, + { cpu_corepower_mask, cpu_corepower_flags, cpu_core_th, SD_INIT_NAME(GMC) }, + { cpu_coregroup_mask, cpu_core_flags, cpu_core_th, SD_INIT_NAME(MC) }, #endif - { cpu_cpu_mask, SD_INIT_NAME(DIE) }, + { cpu_cpu_mask, NULL, cpu_cluster_th, SD_INIT_NAME(DIE) }, { NULL, }, }; |