Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 156722
b: refs/heads/master
c: 0d01f31
h: refs/heads/master
v: v3
  • Loading branch information
Dmitry Torokhov authored and Ingo Molnar committed Aug 11, 2009
1 parent 4477075 commit 3e7c887
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3e03bbeac541856aaaf1ce1ab0250b6a490e4099
refs/heads/master: 0d01f31439c1e4d602bf9fdc924ab66f407f5e38
18 changes: 11 additions & 7 deletions trunk/arch/x86/kernel/cpu/mcheck/therm_throt.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

static DEFINE_PER_CPU(__u64, next_check) = INITIAL_JIFFIES;
static DEFINE_PER_CPU(unsigned long, thermal_throttle_count);
static DEFINE_PER_CPU(bool, thermal_throttle_active);

static atomic_t therm_throt_en = ATOMIC_INIT(0);

Expand Down Expand Up @@ -96,24 +97,27 @@ static int therm_throt_process(int curr)
{
unsigned int cpu = smp_processor_id();
__u64 tmp_jiffs = get_jiffies_64();
bool was_throttled = __get_cpu_var(thermal_throttle_active);
bool is_throttled = __get_cpu_var(thermal_throttle_active) = curr;

if (curr)
if (is_throttled)
__get_cpu_var(thermal_throttle_count)++;

if (time_before64(tmp_jiffs, __get_cpu_var(next_check)))
if (!(was_throttled ^ is_throttled) &&
time_before64(tmp_jiffs, __get_cpu_var(next_check)))
return 0;

__get_cpu_var(next_check) = tmp_jiffs + CHECK_INTERVAL;

/* if we just entered the thermal event */
if (curr) {
if (is_throttled) {
printk(KERN_CRIT "CPU%d: Temperature above threshold, "
"cpu clock throttled (total events = %lu)\n", cpu,
__get_cpu_var(thermal_throttle_count));
"cpu clock throttled (total events = %lu)\n",
cpu, __get_cpu_var(thermal_throttle_count));

add_taint(TAINT_MACHINE_CHECK);
} else {
printk(KERN_CRIT "CPU%d: Temperature/speed normal\n", cpu);
} else if (was_throttled) {
printk(KERN_INFO "CPU%d: Temperature/speed normal\n", cpu);
}

return 1;
Expand Down

0 comments on commit 3e7c887

Please sign in to comment.