Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh: Support SCHED_MC for SH-X3 multi-cores.

This enables SCHED_MC support for SH-X3 multi-cores. Presently this is
just a simple wrapper around the possible map, but this allows for
tying in support for some of the more exotic NUMA clusters where we can
actually do something with the topology.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

+43
+8
arch/sh/include/asm/topology.h
··· 40 40 41 41 #endif 42 42 43 + #define mc_capable() (1) 44 + 45 + const struct cpumask *cpu_coregroup_mask(unsigned int cpu); 46 + 47 + extern cpumask_t cpu_core_map[NR_CPUS]; 48 + 49 + #define topology_core_cpumask(cpu) (&cpu_core_map[cpu]) 50 + 43 51 #include <asm-generic/topology.h> 44 52 45 53 #endif /* _ASM_SH_TOPOLOGY_H */
+26
arch/sh/kernel/topology.c
··· 16 16 17 17 static DEFINE_PER_CPU(struct cpu, cpu_devices); 18 18 19 + cpumask_t cpu_core_map[NR_CPUS]; 20 + 21 + static cpumask_t cpu_coregroup_map(unsigned int cpu) 22 + { 23 + /* 24 + * Presently all SH-X3 SMP cores are multi-cores, so just keep it 25 + * simple until we have a method for determining topology.. 26 + */ 27 + return cpu_possible_map; 28 + } 29 + 30 + const struct cpumask *cpu_coregroup_mask(unsigned int cpu) 31 + { 32 + return &cpu_core_map[cpu]; 33 + } 34 + 35 + int arch_update_cpu_topology(void) 36 + { 37 + unsigned int cpu; 38 + 39 + for_each_possible_cpu(cpu) 40 + cpu_core_map[cpu] = cpu_coregroup_map(cpu); 41 + 42 + return 0; 43 + } 44 + 19 45 static int __init topology_init(void) 20 46 { 21 47 int i, ret;
+9
arch/sh/mm/Kconfig
··· 256 256 257 257 source "mm/Kconfig" 258 258 259 + config SCHED_MC 260 + bool "Multi-core scheduler support" 261 + depends on SMP 262 + default y 263 + help 264 + Multi-core scheduler support improves the CPU scheduler's decision 265 + making when dealing with multi-core CPU chips at a cost of slightly 266 + increased overhead in some places. If unsure say N here. 267 + 259 268 endmenu 260 269 261 270 menu "Cache configuration"