Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147450
b: refs/heads/master
c: f5a5a2f
h: refs/heads/master
v: v3
  • Loading branch information
Ingo Molnar committed May 15, 2009
1 parent 9d2a22f commit 7c9287e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 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: ec3232bdf8518bea8410f0027f870b24d3aa8753
refs/heads/master: f5a5a2f6e69e88647ae12da39f0ff3a510bcf0a6
20 changes: 15 additions & 5 deletions trunk/arch/x86/kernel/cpu/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -765,8 +765,13 @@ static int intel_pmu_handle_irq(struct pt_regs *regs, int nmi)
/*
* Restore - do not reenable when global enable is off or throttled:
*/
if (++cpuc->interrupts < PERFMON_MAX_INTERRUPTS)
intel_pmu_restore_all(cpuc->throttle_ctrl);
if (cpuc->throttle_ctrl) {
if (++cpuc->interrupts < PERFMON_MAX_INTERRUPTS) {
intel_pmu_restore_all(cpuc->throttle_ctrl);
} else {
pr_info("CPU#%d: perfcounters: max interrupt rate exceeded! Throttle on.\n", smp_processor_id());
}
}

return ret;
}
Expand Down Expand Up @@ -817,11 +822,16 @@ void perf_counter_unthrottle(void)

cpuc = &__get_cpu_var(cpu_hw_counters);
if (cpuc->interrupts >= PERFMON_MAX_INTERRUPTS) {
if (printk_ratelimit())
printk(KERN_WARNING "perfcounters: max interrupts exceeded!\n");
pr_info("CPU#%d: perfcounters: throttle off.\n", smp_processor_id());

/*
* Clear them before re-enabling irqs/NMIs again:
*/
cpuc->interrupts = 0;
hw_perf_restore(cpuc->throttle_ctrl);
} else {
cpuc->interrupts = 0;
}
cpuc->interrupts = 0;
}

void smp_perf_counter_interrupt(struct pt_regs *regs)
Expand Down

0 comments on commit 7c9287e

Please sign in to comment.