* [PATCH 2/2] x86 thermal: Disable power limit notification interrupt by default
2013-05-21 19:35 ` [PATCH 1/2] x86 thermal: Delete power-limit-notification console messages Len Brown
@ 2013-05-21 19:35 ` Len Brown
2013-05-22 4:54 ` [PATCH 1/2] x86 thermal: Delete power-limit-notification console messages R, Durgadoss
2013-05-28 2:17 ` Zhang Rui
2 siblings, 0 replies; 9+ messages in thread
From: Len Brown @ 2013-05-21 19:35 UTC (permalink / raw)
To: rui.zhang; +Cc: linux-pm, Fenghua Yu
From: Fenghua Yu <fenghua.yu@intel.com>
The package power limit notification interrupt is primarily for
system diagnosis, and should not be blindly enabled on every
system by default -- particuarly since Linux does nothing in the
handler except count how many times it has been called...
Add a new kernel cmdline parameter "int_pln_enable" for situations where
users want to oberve these events via existing system counters:
$ grep TRM /proc/interrupts
$ grep . /sys/devices/system/cpu/cpu*/thermal_throttle/*
https://bugzilla.kernel.org/show_bug.cgi?id=36182
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
Documentation/kernel-parameters.txt | 2 ++
arch/x86/kernel/cpu/mcheck/therm_throt.c | 34 ++++++++++++++++++++++++--------
2 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 8ccbf27..217165b 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1130,6 +1130,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
inport.irq= [HW] Inport (ATI XL and Microsoft) busmouse driver
Format: <irq>
+ int_pln_enable [x86] Enable power limit notification interrupt
+
intel_iommu= [DMAR] Intel IOMMU driver (DMAR) option
on
Enable intel iommu driver.
diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c
index 68fa890..f7feb2e 100644
--- a/arch/x86/kernel/cpu/mcheck/therm_throt.c
+++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
@@ -210,6 +210,15 @@ static int thresh_event_valid(int event)
return 1;
}
+static bool int_pln_enable;
+static int __init int_pln_enable_setup(char *s)
+{
+ int_pln_enable = true;
+
+ return 1;
+}
+__setup("int_pln_enable", int_pln_enable_setup);
+
#ifdef CONFIG_SYSFS
/* Add/Remove thermal_throttle interface for CPU device: */
static __cpuinit int thermal_throttle_add_dev(struct device *dev,
@@ -222,7 +231,7 @@ static __cpuinit int thermal_throttle_add_dev(struct device *dev,
if (err)
return err;
- if (cpu_has(c, X86_FEATURE_PLN))
+ if (cpu_has(c, X86_FEATURE_PLN) && int_pln_enable)
err = sysfs_add_file_to_group(&dev->kobj,
&dev_attr_core_power_limit_count.attr,
thermal_attr_group.name);
@@ -230,7 +239,7 @@ static __cpuinit int thermal_throttle_add_dev(struct device *dev,
err = sysfs_add_file_to_group(&dev->kobj,
&dev_attr_package_throttle_count.attr,
thermal_attr_group.name);
- if (cpu_has(c, X86_FEATURE_PLN))
+ if (cpu_has(c, X86_FEATURE_PLN) && int_pln_enable)
err = sysfs_add_file_to_group(&dev->kobj,
&dev_attr_package_power_limit_count.attr,
thermal_attr_group.name);
@@ -343,7 +352,7 @@ static void intel_thermal_interrupt(void)
CORE_LEVEL) != 0)
mce_log_therm_throt_event(msr_val);
- if (this_cpu_has(X86_FEATURE_PLN))
+ if (this_cpu_has(X86_FEATURE_PLN) && int_pln_enable)
therm_throt_process(msr_val & THERM_STATUS_POWER_LIMIT,
POWER_LIMIT_EVENT,
CORE_LEVEL);
@@ -353,7 +362,7 @@ static void intel_thermal_interrupt(void)
therm_throt_process(msr_val & PACKAGE_THERM_STATUS_PROCHOT,
THERMAL_THROTTLING_EVENT,
PACKAGE_LEVEL);
- if (this_cpu_has(X86_FEATURE_PLN))
+ if (this_cpu_has(X86_FEATURE_PLN) && int_pln_enable)
therm_throt_process(msr_val &
PACKAGE_THERM_STATUS_POWER_LIMIT,
POWER_LIMIT_EVENT,
@@ -461,9 +470,13 @@ void intel_init_thermal(struct cpuinfo_x86 *c)
apic_write(APIC_LVTTHMR, h);
rdmsr(MSR_IA32_THERM_INTERRUPT, l, h);
- if (cpu_has(c, X86_FEATURE_PLN))
+ if (cpu_has(c, X86_FEATURE_PLN) && !int_pln_enable)
+ wrmsr(MSR_IA32_THERM_INTERRUPT,
+ (l | (THERM_INT_LOW_ENABLE
+ | THERM_INT_HIGH_ENABLE)) & ~THERM_INT_PLN_ENABLE, h);
+ else if (cpu_has(c, X86_FEATURE_PLN) && int_pln_enable)
wrmsr(MSR_IA32_THERM_INTERRUPT,
- l | (THERM_INT_LOW_ENABLE
+ l | (THERM_INT_LOW_ENABLE
| THERM_INT_HIGH_ENABLE | THERM_INT_PLN_ENABLE), h);
else
wrmsr(MSR_IA32_THERM_INTERRUPT,
@@ -471,9 +484,14 @@ void intel_init_thermal(struct cpuinfo_x86 *c)
if (cpu_has(c, X86_FEATURE_PTS)) {
rdmsr(MSR_IA32_PACKAGE_THERM_INTERRUPT, l, h);
- if (cpu_has(c, X86_FEATURE_PLN))
+ if (cpu_has(c, X86_FEATURE_PLN) && !int_pln_enable)
wrmsr(MSR_IA32_PACKAGE_THERM_INTERRUPT,
- l | (PACKAGE_THERM_INT_LOW_ENABLE
+ (l | (PACKAGE_THERM_INT_LOW_ENABLE
+ | PACKAGE_THERM_INT_HIGH_ENABLE))
+ & ~PACKAGE_THERM_INT_PLN_ENABLE, h);
+ else if (cpu_has(c, X86_FEATURE_PLN) && int_pln_enable)
+ wrmsr(MSR_IA32_PACKAGE_THERM_INTERRUPT,
+ l | (PACKAGE_THERM_INT_LOW_ENABLE
| PACKAGE_THERM_INT_HIGH_ENABLE
| PACKAGE_THERM_INT_PLN_ENABLE), h);
else
--
1.8.3.rc2
^ permalink raw reply related [flat|nested] 9+ messages in thread
* RE: [PATCH 1/2] x86 thermal: Delete power-limit-notification console messages
2013-05-21 19:35 ` [PATCH 1/2] x86 thermal: Delete power-limit-notification console messages Len Brown
2013-05-21 19:35 ` [PATCH 2/2] x86 thermal: Disable power limit notification interrupt by default Len Brown
@ 2013-05-22 4:54 ` R, Durgadoss
2013-05-22 23:31 ` Yu, Fenghua
2013-05-28 2:17 ` Zhang Rui
2 siblings, 1 reply; 9+ messages in thread
From: R, Durgadoss @ 2013-05-22 4:54 UTC (permalink / raw)
To: Len Brown, Zhang, Rui; +Cc: linux-pm@vger.kernel.org, Yu, Fenghua
Hi Len/Fenghua,
> -----Original Message-----
> From: linux-pm-owner@vger.kernel.org [mailto:linux-pm-
> owner@vger.kernel.org] On Behalf Of Len Brown
> Sent: Wednesday, May 22, 2013 1:05 AM
> To: Zhang, Rui
> Cc: linux-pm@vger.kernel.org; Yu, Fenghua
> Subject: [PATCH 1/2] x86 thermal: Delete power-limit-notification console
> messages
>
> From: Fenghua Yu <fenghua.yu@intel.com>
>
> Package power limits are common on some systems under some conditions -
> -
> so printing console messages when limits are reached
> causes unnecessary customer concern and support calls.
We are facing the exact similar situation here, but on the
Thermal throttling events. So, basically I am in support of
this removal patch.
>
> Note that even with these console messages gone,
> the events can still be observed via system counters:
>
> $ grep TRM /proc/interrupts
>
> Shows total thermal interrupts, which includes both power
> limit notifications and thermal throttling interrupts.
Yes, On the other hand, we can use these counters, and not
print those console messages.
>
> $ grep . /sys/devices/system/cpu/cpu*/thermal_throttle/*
>
> Will show what caused those interrupts, core and package
> throttling and power limit notifications.
>
> https://bugzilla.kernel.org/show_bug.cgi?id=36182
Thanks for the link ;)
>
> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
> Signed-off-by: Len Brown <len.brown@intel.com>
> ---
> arch/x86/kernel/cpu/mcheck/therm_throt.c | 9 ---------
> 1 file changed, 9 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c
> b/arch/x86/kernel/cpu/mcheck/therm_throt.c
> index 47a1870..68fa890 100644
> --- a/arch/x86/kernel/cpu/mcheck/therm_throt.c
> +++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
> @@ -181,11 +181,6 @@ static int therm_throt_process(bool new_event, int
> event, int level)
> this_cpu,
> level == CORE_LEVEL ? "Core" : "Package",
> state->count);
Here, can we remove the other print also ?
(The thermal throttling prints)
Thanks,
Durga
> - else
> - printk(KERN_CRIT "CPU%d: %s power limit
> notification (total events = %lu)\n",
> - this_cpu,
> - level == CORE_LEVEL ? "Core" : "Package",
> - state->count);
> return 1;
> }
> if (old_event) {
> @@ -193,10 +188,6 @@ static int therm_throt_process(bool new_event, int
> event, int level)
> printk(KERN_INFO "CPU%d: %s temperature/speed
> normal\n",
> this_cpu,
> level == CORE_LEVEL ? "Core" : "Package");
> - else
> - printk(KERN_INFO "CPU%d: %s power limit
> normal\n",
> - this_cpu,
> - level == CORE_LEVEL ? "Core" : "Package");
> return 1;
> }
>
> --
> 1.8.3.rc2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH 1/2] x86 thermal: Delete power-limit-notification console messages
2013-05-22 4:54 ` [PATCH 1/2] x86 thermal: Delete power-limit-notification console messages R, Durgadoss
@ 2013-05-22 23:31 ` Yu, Fenghua
0 siblings, 0 replies; 9+ messages in thread
From: Yu, Fenghua @ 2013-05-22 23:31 UTC (permalink / raw)
To: R, Durgadoss, Len Brown, Zhang, Rui, Andi Kleen; +Cc: linux-pm@vger.kernel.org
> From: R, Durgadoss
> Hi Len/Fenghua,
>
> > -----Original Message-----
> > From: linux-pm-owner@vger.kernel.org [mailto:linux-pm-
> > owner@vger.kernel.org] On Behalf Of Len Brown
> > Sent: Wednesday, May 22, 2013 1:05 AM
> > To: Zhang, Rui
> > Cc: linux-pm@vger.kernel.org; Yu, Fenghua
> > Subject: [PATCH 1/2] x86 thermal: Delete power-limit-notification
> console
> > messages
> >
> > From: Fenghua Yu <fenghua.yu@intel.com>
> >
> > diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c
> > b/arch/x86/kernel/cpu/mcheck/therm_throt.c
> > index 47a1870..68fa890 100644
> > --- a/arch/x86/kernel/cpu/mcheck/therm_throt.c
> > +++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
> > @@ -181,11 +181,6 @@ static int therm_throt_process(bool new_event,
> int
> > event, int level)
> > this_cpu,
> > level == CORE_LEVEL ? "Core" : "Package",
> > state->count);
>
> Here, can we remove the other print also ?
> (The thermal throttling prints)
The thermal throttling is legacy code and users could use the printed info already. Adding Andi who wrote the thermal throttling code and may have more insight.
Thanks.
-Fenghua
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] x86 thermal: Delete power-limit-notification console messages
2013-05-21 19:35 ` [PATCH 1/2] x86 thermal: Delete power-limit-notification console messages Len Brown
2013-05-21 19:35 ` [PATCH 2/2] x86 thermal: Disable power limit notification interrupt by default Len Brown
2013-05-22 4:54 ` [PATCH 1/2] x86 thermal: Delete power-limit-notification console messages R, Durgadoss
@ 2013-05-28 2:17 ` Zhang Rui
2013-06-25 18:53 ` Yu, Fenghua
2 siblings, 1 reply; 9+ messages in thread
From: Zhang Rui @ 2013-05-28 2:17 UTC (permalink / raw)
To: Len Brown; +Cc: linux-pm, Fenghua Yu
On Tue, 2013-05-21 at 15:35 -0400, Len Brown wrote:
> From: Fenghua Yu <fenghua.yu@intel.com>
>
> Package power limits are common on some systems under some conditions --
> so printing console messages when limits are reached
> causes unnecessary customer concern and support calls.
>
> Note that even with these console messages gone,
> the events can still be observed via system counters:
>
> $ grep TRM /proc/interrupts
>
> Shows total thermal interrupts, which includes both power
> limit notifications and thermal throttling interrupts.
>
> $ grep . /sys/devices/system/cpu/cpu*/thermal_throttle/*
>
> Will show what caused those interrupts, core and package
> throttling and power limit notifications.
>
> https://bugzilla.kernel.org/show_bug.cgi?id=36182
>
> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
> Signed-off-by: Len Brown <len.brown@intel.com>
who should take these two patches?
thanks,
rui
> ---
> arch/x86/kernel/cpu/mcheck/therm_throt.c | 9 ---------
> 1 file changed, 9 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c
> index 47a1870..68fa890 100644
> --- a/arch/x86/kernel/cpu/mcheck/therm_throt.c
> +++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
> @@ -181,11 +181,6 @@ static int therm_throt_process(bool new_event, int event, int level)
> this_cpu,
> level == CORE_LEVEL ? "Core" : "Package",
> state->count);
> - else
> - printk(KERN_CRIT "CPU%d: %s power limit notification (total events = %lu)\n",
> - this_cpu,
> - level == CORE_LEVEL ? "Core" : "Package",
> - state->count);
> return 1;
> }
> if (old_event) {
> @@ -193,10 +188,6 @@ static int therm_throt_process(bool new_event, int event, int level)
> printk(KERN_INFO "CPU%d: %s temperature/speed normal\n",
> this_cpu,
> level == CORE_LEVEL ? "Core" : "Package");
> - else
> - printk(KERN_INFO "CPU%d: %s power limit normal\n",
> - this_cpu,
> - level == CORE_LEVEL ? "Core" : "Package");
> return 1;
> }
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH 1/2] x86 thermal: Delete power-limit-notification console messages
2013-05-28 2:17 ` Zhang Rui
@ 2013-06-25 18:53 ` Yu, Fenghua
0 siblings, 0 replies; 9+ messages in thread
From: Yu, Fenghua @ 2013-06-25 18:53 UTC (permalink / raw)
To: Zhang, Rui, Len Brown; +Cc: linux-pm@vger.kernel.org
> From: Zhang, Rui
> Sent: Monday, May 27, 2013 7:17 PM
>
> On Tue, 2013-05-21 at 15:35 -0400, Len Brown wrote:
> > From: Fenghua Yu <fenghua.yu@intel.com>
> >
> > Package power limits are common on some systems under some conditions
> --
> > so printing console messages when limits are reached
> > causes unnecessary customer concern and support calls.
> >
> > Note that even with these console messages gone,
> > the events can still be observed via system counters:
> >
> > $ grep TRM /proc/interrupts
> >
> > Shows total thermal interrupts, which includes both power
> > limit notifications and thermal throttling interrupts.
> >
> > $ grep . /sys/devices/system/cpu/cpu*/thermal_throttle/*
> >
> > Will show what caused those interrupts, core and package
> > throttling and power limit notifications.
> >
> > https://bugzilla.kernel.org/show_bug.cgi?id=36182
> >
> > Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
> > Signed-off-by: Len Brown <len.brown@intel.com>
>
> who should take these two patches?
>
> thanks,
> rui
I don't see the patches in upstream or tip trees. Are the patches on track in upstream?
Thanks.
-Fenghua
^ permalink raw reply [flat|nested] 9+ messages in thread