diff options
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/cpu/perf_event_p4.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_p4.c b/arch/x86/kernel/cpu/perf_event_p4.c index 107711bf0ee8..febb12cea795 100644 --- a/arch/x86/kernel/cpu/perf_event_p4.c +++ b/arch/x86/kernel/cpu/perf_event_p4.c | |||
@@ -656,6 +656,7 @@ static int p4_pmu_handle_irq(struct pt_regs *regs) | |||
656 | cpuc = &__get_cpu_var(cpu_hw_events); | 656 | cpuc = &__get_cpu_var(cpu_hw_events); |
657 | 657 | ||
658 | for (idx = 0; idx < x86_pmu.num_counters; idx++) { | 658 | for (idx = 0; idx < x86_pmu.num_counters; idx++) { |
659 | int overflow; | ||
659 | 660 | ||
660 | if (!test_bit(idx, cpuc->active_mask)) | 661 | if (!test_bit(idx, cpuc->active_mask)) |
661 | continue; | 662 | continue; |
@@ -666,12 +667,14 @@ static int p4_pmu_handle_irq(struct pt_regs *regs) | |||
666 | WARN_ON_ONCE(hwc->idx != idx); | 667 | WARN_ON_ONCE(hwc->idx != idx); |
667 | 668 | ||
668 | /* it might be unflagged overflow */ | 669 | /* it might be unflagged overflow */ |
669 | handled = p4_pmu_clear_cccr_ovf(hwc); | 670 | overflow = p4_pmu_clear_cccr_ovf(hwc); |
670 | 671 | ||
671 | val = x86_perf_event_update(event); | 672 | val = x86_perf_event_update(event); |
672 | if (!handled && (val & (1ULL << (x86_pmu.cntval_bits - 1)))) | 673 | if (!overflow && (val & (1ULL << (x86_pmu.cntval_bits - 1)))) |
673 | continue; | 674 | continue; |
674 | 675 | ||
676 | handled += overflow; | ||
677 | |||
675 | /* event overflow for sure */ | 678 | /* event overflow for sure */ |
676 | data.period = event->hw.last_period; | 679 | data.period = event->hw.last_period; |
677 | 680 | ||
@@ -687,7 +690,7 @@ static int p4_pmu_handle_irq(struct pt_regs *regs) | |||
687 | inc_irq_stat(apic_perf_irqs); | 690 | inc_irq_stat(apic_perf_irqs); |
688 | } | 691 | } |
689 | 692 | ||
690 | return handled; | 693 | return handled > 0; |
691 | } | 694 | } |
692 | 695 | ||
693 | /* | 696 | /* |