* [PATCH] Don't export sched_mc_power_savings in laptops
@ 2008-11-29 11:20 Mahesh Salgaonkar
2008-11-29 11:30 ` Mahesh Jagannath Salgaonkar
2008-11-30 17:40 ` Ingo Molnar
0 siblings, 2 replies; 5+ messages in thread
From: Mahesh Salgaonkar @ 2008-11-29 11:20 UTC (permalink / raw)
To: Linux Kernel, Suresh B Siddha, Venkatesh Pallipadi, Ingo Molnar; +Cc: mahesh
Fix to prevent sched_mc_power_saving from being exported through sysfs
for 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 <mahesh@linux.vnet.ibm.com>
diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
index 4850e4b..4adc830 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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] Don't export sched_mc_power_savings in laptops
2008-11-29 11:20 [PATCH] Don't export sched_mc_power_savings in laptops Mahesh Salgaonkar
@ 2008-11-29 11:30 ` Mahesh Jagannath Salgaonkar
2008-11-30 17:40 ` Ingo Molnar
1 sibling, 0 replies; 5+ messages in thread
From: Mahesh Jagannath Salgaonkar @ 2008-11-29 11:30 UTC (permalink / raw)
To: Linux Kernel, Suresh B Siddha, Venkatesh Pallipadi, Ingo Molnar
Mahesh Salgaonkar wrote:
> Fix to prevent sched_mc_power_saving from being exported through sysfs
> for 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 <mahesh@linux.vnet.ibm.com>
>
> diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
> index 4850e4b..4adc830 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
>
>
The sched_mc_power_savings in sysfs does not help on single socket
multicore laptops.
The above patch has been tested on dual core laptop and dual socket quad
core intel processor based server.
Thanks,
-Mahesh.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Don't export sched_mc_power_savings in laptops
2008-11-29 11:20 [PATCH] Don't export sched_mc_power_savings in laptops Mahesh Salgaonkar
2008-11-29 11:30 ` Mahesh Jagannath Salgaonkar
@ 2008-11-30 17:40 ` Ingo Molnar
2008-12-01 6:50 ` Mahesh Jagannath Salgaonkar
1 sibling, 1 reply; 5+ messages in thread
From: Ingo Molnar @ 2008-11-30 17:40 UTC (permalink / raw)
To: Mahesh Salgaonkar
Cc: Linux Kernel, Suresh B Siddha, Venkatesh Pallipadi,
Peter Zijlstra
* Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> wrote:
> Fix to prevent sched_mc_power_saving from being exported through sysfs
> for 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 <mahesh@linux.vnet.ibm.com>
>
> diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
> index 4850e4b..4adc830 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)
hm, dunno. sched_mc_power_savings should have no effect on single-socket
systems, right? So the knob should have no effect.
Ingo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Don't export sched_mc_power_savings in laptops
2008-11-30 17:40 ` Ingo Molnar
@ 2008-12-01 6:50 ` Mahesh Jagannath Salgaonkar
2008-12-01 7:44 ` Ingo Molnar
0 siblings, 1 reply; 5+ messages in thread
From: Mahesh Jagannath Salgaonkar @ 2008-12-01 6:50 UTC (permalink / raw)
To: Ingo Molnar
Cc: Linux Kernel, Suresh B Siddha, Venkatesh Pallipadi,
Peter Zijlstra, svaidy
Ingo Molnar wrote:
> * Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> wrote:
>
>
>> Fix to prevent sched_mc_power_saving from being exported through sysfs
>> for 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 <mahesh@linux.vnet.ibm.com>
>>
>> diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
>> index 4850e4b..4adc830 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)
>>
>
> hm, dunno. sched_mc_power_savings should have no effect on single-socket
> systems, right? So the knob should have no effect.
>
> Ingo
>
Hi Ingo,
Yes, it will not have any effect but it enables additional code path
leading to an
overhead in case of single-socket system. This overhead is only if
"sched_mc_power_savings = 1", however we are still leaving it to zero
(default) and
preventing user space from turning it on by mistake.
Thanks,
-Mahesh.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Don't export sched_mc_power_savings in laptops
2008-12-01 6:50 ` Mahesh Jagannath Salgaonkar
@ 2008-12-01 7:44 ` Ingo Molnar
0 siblings, 0 replies; 5+ messages in thread
From: Ingo Molnar @ 2008-12-01 7:44 UTC (permalink / raw)
To: Mahesh Jagannath Salgaonkar
Cc: Linux Kernel, Suresh B Siddha, Venkatesh Pallipadi,
Peter Zijlstra, svaidy
* Mahesh Jagannath Salgaonkar <mahesh@linux.vnet.ibm.com> wrote:
> Ingo Molnar wrote:
>> * Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> wrote:
>>
>>
>>> Fix to prevent sched_mc_power_saving from being exported through sysfs
>>> for 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
>>> <mahesh@linux.vnet.ibm.com>
>>>
>>> diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
>>> index 4850e4b..4adc830 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)
>>>
>>
>> hm, dunno. sched_mc_power_savings should have no effect on
>> single-socket systems, right? So the knob should have no effect.
>>
>> Ingo
>>
> Hi Ingo,
>
> Yes, it will not have any effect but it enables additional code path
> leading to an overhead in case of single-socket system. This overhead
> is only if "sched_mc_power_savings = 1", however we are still leaving
> it to zero (default) and preventing user space from turning it on by
> mistake.
okay, makes sense - i've applied it to tip/sched/urgent (for v2.6.28
merge), thanks Mahesh!
Ingo
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-12-01 7:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-29 11:20 [PATCH] Don't export sched_mc_power_savings in laptops Mahesh Salgaonkar
2008-11-29 11:30 ` Mahesh Jagannath Salgaonkar
2008-11-30 17:40 ` Ingo Molnar
2008-12-01 6:50 ` Mahesh Jagannath Salgaonkar
2008-12-01 7:44 ` Ingo Molnar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox