-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 35980 b: refs/heads/master c: 15d5f83 h: refs/heads/master v: v3
- Loading branch information
Dmitriy Zavin
authored and
Andi Kleen
committed
Sep 26, 2006
1 parent
84c0839
commit c604980
Showing
10 changed files
with
110 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 3b171672831b9633c2ed8fa94805255cd4d5af19 | ||
refs/heads/master: 15d5f8398311f565682959daaca30e3ca7aea600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
obj-y = mce.o k7.o p4.o p5.o p6.o winchip.o | ||
obj-y = mce.o k7.o p4.o p5.o p6.o winchip.o therm_throt.o | ||
obj-$(CONFIG_X86_MCE_NONFATAL) += non-fatal.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* linux/arch/i386/kerne/cpu/mcheck/therm_throt.c | ||
* | ||
* Thermal throttle event support code. | ||
* | ||
* Author: Dmitriy Zavin (dmitriyz@google.com) | ||
* | ||
* Credits: Adapted from Zwane Mwaikambo's original code in mce_intel.c. | ||
* | ||
*/ | ||
|
||
#include <linux/percpu.h> | ||
#include <linux/cpu.h> | ||
#include <asm/cpu.h> | ||
#include <linux/notifier.h> | ||
#include <asm/therm_throt.h> | ||
|
||
/* How long to wait between reporting thermal events */ | ||
#define CHECK_INTERVAL (300 * HZ) | ||
|
||
static DEFINE_PER_CPU(unsigned long, next_check); | ||
|
||
/*** | ||
* therm_throt_process - Process thermal throttling event | ||
* @curr: Whether the condition is current or not (boolean), since the | ||
* thermal interrupt normally gets called both when the thermal | ||
* event begins and once the event has ended. | ||
* | ||
* This function is normally called by the thermal interrupt after the | ||
* IRQ has been acknowledged. | ||
* | ||
* It will take care of rate limiting and printing messages to the syslog. | ||
* | ||
* Returns: 0 : Event should NOT be further logged, i.e. still in | ||
* "timeout" from previous log message. | ||
* 1 : Event should be logged further, and a message has been | ||
* printed to the syslog. | ||
*/ | ||
int therm_throt_process(int curr) | ||
{ | ||
unsigned int cpu = smp_processor_id(); | ||
|
||
if (time_before(jiffies, __get_cpu_var(next_check))) | ||
return 0; | ||
|
||
__get_cpu_var(next_check) = jiffies + CHECK_INTERVAL; | ||
|
||
/* if we just entered the thermal event */ | ||
if (curr) { | ||
printk(KERN_CRIT "CPU%d: Temperature above threshold, " | ||
"cpu clock throttled\n", cpu); | ||
add_taint(TAINT_MACHINE_CHECK); | ||
} else { | ||
printk(KERN_CRIT "CPU%d: Temperature/speed normal\n", cpu); | ||
} | ||
|
||
return 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef __ASM_I386_THERM_THROT_H__ | ||
#define __ASM_I386_THERM_THROT_H__ 1 | ||
|
||
int therm_throt_process(int curr); | ||
|
||
#endif /* __ASM_I386_THERM_THROT_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include <asm-i386/therm_throt.h> |