aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/smp.c
diff options
context:
space:
mode:
authorVincent Guittot <vincent.guittot@linaro.org>2011-08-08 08:21:59 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-10-17 04:02:43 -0400
commitc9018aab8eee24b993c12c7aff7fc99d3d73f298 (patch)
tree9c03698cff4bda12364af7c84ed09122219bbc2c /arch/arm/kernel/smp.c
parentd0a77454c70d0449a5f87087deb8f0cb15145e90 (diff)
ARM: 7011/1: Add ARM cpu topology definition
The affinity between ARM processors is defined in the MPIDR register. We can identify which processors are in the same cluster, and which ones have performance interdependency. We can define the cpu topology of ARM platform, that is then used by sched_mc and sched_smt. The default state of sched_mc and sched_smt config is disable. When enabled, the behavior of the scheduler can be modified with sched_mc_power_savings and sched_smt_power_savings sysfs interfaces. Changes since v4 : * Remove unnecessary parentheses and blank lines Changes since v3 : * Update the format of printk message * Remove blank line Changes since v2 : * Update the commit message and some comments Changes since v1 : * Update the commit message * Add read_cpuid_mpidr in arch/arm/include/asm/cputype.h * Modify header of arch/arm/kernel/topology.c * Modify tests and manipulation of MPIDR's bitfields * Modify the place and dependancy of the config * Modify Noop functions Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org> Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/smp.c')
-rw-r--r--arch/arm/kernel/smp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index d88ff0230e8..62775c5c5ba 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -31,6 +31,7 @@
31#include <asm/cacheflush.h> 31#include <asm/cacheflush.h>
32#include <asm/cpu.h> 32#include <asm/cpu.h>
33#include <asm/cputype.h> 33#include <asm/cputype.h>
34#include <asm/topology.h>
34#include <asm/mmu_context.h> 35#include <asm/mmu_context.h>
35#include <asm/pgtable.h> 36#include <asm/pgtable.h>
36#include <asm/pgalloc.h> 37#include <asm/pgalloc.h>
@@ -268,6 +269,8 @@ static void __cpuinit smp_store_cpu_info(unsigned int cpuid)
268 struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpuid); 269 struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpuid);
269 270
270 cpu_info->loops_per_jiffy = loops_per_jiffy; 271 cpu_info->loops_per_jiffy = loops_per_jiffy;
272
273 store_cpu_topology(cpuid);
271} 274}
272 275
273/* 276/*
@@ -358,6 +361,8 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
358{ 361{
359 unsigned int ncores = num_possible_cpus(); 362 unsigned int ncores = num_possible_cpus();
360 363
364 init_cpu_topology();
365
361 smp_store_cpu_info(smp_processor_id()); 366 smp_store_cpu_info(smp_processor_id());
362 367
363 /* 368 /*