aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2010-03-08 07:51:01 -0500
committerIngo Molnar <mingo@elte.hu>2010-03-10 07:22:26 -0500
commit3fb2b8ddcc6a7aa62af6bd2cb939edfd4c460506 (patch)
treee86a4fc239653fe55d448d28f1841fb9875fe102
parent32975a4f114be52286f9a5bf6c230dbb8c0e1903 (diff)
perf, x86, Do not user perf_disable from NMI context
Explicitly use intel_pmu_{disable,enable}_all() in intel_pmu_handle_irq() to avoid the NMI race conditions in perf_{disable,enable} Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: paulus@samba.org Cc: eranian@google.com Cc: robert.richter@amd.com Cc: fweisbec@gmail.com LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/kernel/cpu/perf_event_intel.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c
index 12e811a7d747..c582449163fa 100644
--- a/arch/x86/kernel/cpu/perf_event_intel.c
+++ b/arch/x86/kernel/cpu/perf_event_intel.c
@@ -745,11 +745,11 @@ static int intel_pmu_handle_irq(struct pt_regs *regs)
745 745
746 cpuc = &__get_cpu_var(cpu_hw_events); 746 cpuc = &__get_cpu_var(cpu_hw_events);
747 747
748 perf_disable(); 748 intel_pmu_disable_all();
749 intel_pmu_drain_bts_buffer(); 749 intel_pmu_drain_bts_buffer();
750 status = intel_pmu_get_status(); 750 status = intel_pmu_get_status();
751 if (!status) { 751 if (!status) {
752 perf_enable(); 752 intel_pmu_enable_all();
753 return 0; 753 return 0;
754 } 754 }
755 755
@@ -759,8 +759,7 @@ again:
759 WARN_ONCE(1, "perfevents: irq loop stuck!\n"); 759 WARN_ONCE(1, "perfevents: irq loop stuck!\n");
760 perf_event_print_debug(); 760 perf_event_print_debug();
761 intel_pmu_reset(); 761 intel_pmu_reset();
762 perf_enable(); 762 goto done;
763 return 1;
764 } 763 }
765 764
766 inc_irq_stat(apic_perf_irqs); 765 inc_irq_stat(apic_perf_irqs);
@@ -790,8 +789,8 @@ again:
790 if (status) 789 if (status)
791 goto again; 790 goto again;
792 791
793 perf_enable(); 792done:
794 793 intel_pmu_enable_all();
795 return 1; 794 return 1;
796} 795}
797 796