diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2006-03-08 19:09:19 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-03-20 04:14:24 -0500 |
commit | 8935dced547afbf37d0fcfcac9a3556494e53104 (patch) | |
tree | 0ae802875c73e99b86e4f90be6e953ec0c528dea | |
parent | 17b0e199a10184d8c5bbbd79a4cee993bb1fb257 (diff) |
[SPARC64]: Add SMT scheduling support for Niagara.
The mapping is a simple "(cpuid >> 2) == core" for now.
Later we'll add more sophisticated code that will walk
the sun4v machine description and figure this out from
there.
We should also add core mappings for jaguar and panther
processors.
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | arch/sparc64/Kconfig | 9 | ||||
-rw-r--r-- | arch/sparc64/kernel/smp.c | 18 | ||||
-rw-r--r-- | include/asm-sparc64/smp.h | 2 |
3 files changed, 29 insertions, 0 deletions
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig index a253a39c3ff..49b652f9b1d 100644 --- a/arch/sparc64/Kconfig +++ b/arch/sparc64/Kconfig | |||
@@ -356,6 +356,15 @@ config SOLARIS_EMUL | |||
356 | 356 | ||
357 | endmenu | 357 | endmenu |
358 | 358 | ||
359 | config SCHED_SMT | ||
360 | bool "SMT (Hyperthreading) scheduler support" | ||
361 | depends on SMP | ||
362 | default y | ||
363 | help | ||
364 | SMT scheduler support improves the CPU scheduler's decision making | ||
365 | when dealing with UltraSPARC cpus at a cost of slightly increased | ||
366 | overhead in some places. If unsure say N here. | ||
367 | |||
359 | config CMDLINE_BOOL | 368 | config CMDLINE_BOOL |
360 | bool "Default bootloader kernel arguments" | 369 | bool "Default bootloader kernel arguments" |
361 | 370 | ||
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c index cf56128097c..373a701c90a 100644 --- a/arch/sparc64/kernel/smp.c +++ b/arch/sparc64/kernel/smp.c | |||
@@ -47,6 +47,8 @@ static unsigned char boot_cpu_id; | |||
47 | 47 | ||
48 | cpumask_t cpu_online_map __read_mostly = CPU_MASK_NONE; | 48 | cpumask_t cpu_online_map __read_mostly = CPU_MASK_NONE; |
49 | cpumask_t phys_cpu_present_map __read_mostly = CPU_MASK_NONE; | 49 | cpumask_t phys_cpu_present_map __read_mostly = CPU_MASK_NONE; |
50 | cpumask_t cpu_sibling_map[NR_CPUS] __read_mostly = | ||
51 | { [0 ... NR_CPUS-1] = CPU_MASK_NONE }; | ||
50 | static cpumask_t smp_commenced_mask; | 52 | static cpumask_t smp_commenced_mask; |
51 | static cpumask_t cpu_callout_map; | 53 | static cpumask_t cpu_callout_map; |
52 | 54 | ||
@@ -1291,6 +1293,8 @@ int setup_profiling_timer(unsigned int multiplier) | |||
1291 | /* Constrain the number of cpus to max_cpus. */ | 1293 | /* Constrain the number of cpus to max_cpus. */ |
1292 | void __init smp_prepare_cpus(unsigned int max_cpus) | 1294 | void __init smp_prepare_cpus(unsigned int max_cpus) |
1293 | { | 1295 | { |
1296 | int i; | ||
1297 | |||
1294 | if (num_possible_cpus() > max_cpus) { | 1298 | if (num_possible_cpus() > max_cpus) { |
1295 | int instance, mid; | 1299 | int instance, mid; |
1296 | 1300 | ||
@@ -1305,6 +1309,20 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
1305 | } | 1309 | } |
1306 | } | 1310 | } |
1307 | 1311 | ||
1312 | for_each_cpu(i) { | ||
1313 | if (tlb_type == hypervisor) { | ||
1314 | int j; | ||
1315 | |||
1316 | /* XXX get this mapping from machine description */ | ||
1317 | for_each_cpu(j) { | ||
1318 | if ((j >> 2) == (i >> 2)) | ||
1319 | cpu_set(j, cpu_sibling_map[i]); | ||
1320 | } | ||
1321 | } else { | ||
1322 | cpu_set(i, cpu_sibling_map[i]); | ||
1323 | } | ||
1324 | } | ||
1325 | |||
1308 | smp_store_cpu_info(boot_cpu_id); | 1326 | smp_store_cpu_info(boot_cpu_id); |
1309 | } | 1327 | } |
1310 | 1328 | ||
diff --git a/include/asm-sparc64/smp.h b/include/asm-sparc64/smp.h index ad1d35a7d13..89d86ecaab2 100644 --- a/include/asm-sparc64/smp.h +++ b/include/asm-sparc64/smp.h | |||
@@ -33,6 +33,8 @@ | |||
33 | extern cpumask_t phys_cpu_present_map; | 33 | extern cpumask_t phys_cpu_present_map; |
34 | #define cpu_possible_map phys_cpu_present_map | 34 | #define cpu_possible_map phys_cpu_present_map |
35 | 35 | ||
36 | extern cpumask_t cpu_sibling_map[NR_CPUS]; | ||
37 | |||
36 | /* | 38 | /* |
37 | * General functions that each host system must provide. | 39 | * General functions that each host system must provide. |
38 | */ | 40 | */ |