All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Don't export sched_mc_power_savings on multi-socket single core system
@ 2009-04-08 11:25 Mahesh Jagannath Salgaonkar
  2009-04-08 11:42 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Mahesh Jagannath Salgaonkar @ 2009-04-08 11:25 UTC (permalink / raw)
  To: Linux Kernel, Suresh B Siddha, Ingo Molnar, Venkatesh Pallipadi
  Cc: svaidy, balbir, dipankar, Peter Zijlstra

Fix to prevent sched_mc_power_saving from being exported through sysfs
for multi-scoket single core system. Max cores should be always greater than
one (1). My earlier patch that introduced fix for not exporting
'sched_mc_power_saving' on laptops  broke it on multi-socket single core
system. This fix addresses issue on both laptop and multi-socket single 
core system.
Below are the Test results:

1. Single socket - multi-core
       Before Patch: Does not export 'sched_mc_power_saving'
       After Patch: Does not export 'sched_mc_power_saving'
       Result: Pass

2. Multi Socket - single core
      Before Patch: exports 'sched_mc_power_saving'
      After Patch: Does not export 'sched_mc_power_saving'
      Result: Pass

3. Multi Socket - Multi core
      Before Patch: exports 'sched_mc_power_saving'
      After Patch: exports 'sched_mc_power_saving'


Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>

Index: linux-2.6/arch/x86/include/asm/topology.h
===================================================================
--- linux-2.6.orig/arch/x86/include/asm/topology.h
+++ linux-2.6/arch/x86/include/asm/topology.h
@@ -203,7 +203,8 @@ struct pci_bus;
 void set_pci_bus_resources_arch_default(struct pci_bus *b);

 #ifdef CONFIG_SMP
-#define mc_capable()   (cpumask_weight(cpu_core_mask(0)) != nr_cpu_ids)
+#define mc_capable()   (boot_cpu_data.x86_max_cores > 1) && \
+                       (cpumask_weight(cpu_core_mask(0)) != nr_cpu_ids)
 #define smt_capable()                  (smp_num_siblings > 1)
 #endif

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-08 12:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-08 11:25 [PATCH] Don't export sched_mc_power_savings on multi-socket single core system Mahesh Jagannath Salgaonkar
2009-04-08 11:42 ` Ingo Molnar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.