aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/perf_counter.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/perf_counter.c')
-rw-r--r--kernel/perf_counter.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c
index ab4455447f84..0bb03f15a5b6 100644
--- a/kernel/perf_counter.c
+++ b/kernel/perf_counter.c
@@ -2822,11 +2822,20 @@ int perf_counter_overflow(struct perf_counter *counter,
2822 2822
2823 if (!throttle) { 2823 if (!throttle) {
2824 counter->hw.interrupts++; 2824 counter->hw.interrupts++;
2825 } else if (counter->hw.interrupts != MAX_INTERRUPTS) { 2825 } else {
2826 counter->hw.interrupts++; 2826 if (counter->hw.interrupts != MAX_INTERRUPTS) {
2827 if (HZ*counter->hw.interrupts > (u64)sysctl_perf_counter_limit) { 2827 counter->hw.interrupts++;
2828 counter->hw.interrupts = MAX_INTERRUPTS; 2828 if (HZ*counter->hw.interrupts > (u64)sysctl_perf_counter_limit) {
2829 perf_log_throttle(counter, 0); 2829 counter->hw.interrupts = MAX_INTERRUPTS;
2830 perf_log_throttle(counter, 0);
2831 ret = 1;
2832 }
2833 } else {
2834 /*
2835 * Keep re-disabling counters even though on the previous
2836 * pass we disabled it - just in case we raced with a
2837 * sched-in and the counter got enabled again:
2838 */
2830 ret = 1; 2839 ret = 1;
2831 } 2840 }
2832 } 2841 }