From: Mahesh Salgaonkar Date: Sat, 29 Nov 2008 11:20:12 +0000 (+0530) Subject: sched: don't export sched_mc_power_savings in laptops X-Git-Tag: v2.6.28-rc8~1^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=43714539eab42b2fa3653ea7bd667b36c2291b11;p=profile%2Fivi%2Fkernel-x86-ivi.git sched: don't export sched_mc_power_savings in laptops Impact: do not expose a control that has no effect Fix to prevent sched_mc_power_saving from being exported through sysfs on single-socket systems. (Say multicore single socket (Laptop)) CPU core map of the boot cpu should be equal to possible number of cpus for single socket system. This fix has been developed at FOSS.in kernel workout. Signed-off-by: Mahesh Salgaonkar Acked-by: Peter Zijlstra Signed-off-by: Ingo Molnar --- diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h index 4850e4b02b6..ff386ff50ed 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h @@ -239,7 +239,7 @@ struct pci_bus; void set_pci_bus_resources_arch_default(struct pci_bus *b); #ifdef CONFIG_SMP -#define mc_capable() (boot_cpu_data.x86_max_cores > 1) +#define mc_capable() (cpus_weight(per_cpu(cpu_core_map, 0)) != nr_cpu_ids) #define smt_capable() (smp_num_siblings > 1) #endif