diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-05-13 02:12:51 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-05-13 02:17:37 -0400 |
commit | 5bb9efe33ea4001a17ab98186a40a134a3061d67 (patch) | |
tree | ecb30329fd190d6db4b8e9c08d42a8d2e6c1e54d /arch/x86/kernel/cpu/perf_counter.c | |
parent | e758a33d6fc5b9d6a3ae489863d04fcecad8120b (diff) |
perf_counter: fix print debug irq disable
inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
bash/15802 [HC0[0]:SC0[0]:HE1:SE1] takes:
(sysrq_key_table_lock){?.....},
Don't unconditionally enable interrupts in the perf_counter_print_debug()
path.
[ Impact: fix potential deadlock pointed out by lockdep ]
LKML-Reference: <new-submission>
Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Diffstat (limited to 'arch/x86/kernel/cpu/perf_counter.c')
-rw-r--r-- | arch/x86/kernel/cpu/perf_counter.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/kernel/cpu/perf_counter.c b/arch/x86/kernel/cpu/perf_counter.c index da27419923a8..f7772ff7936e 100644 --- a/arch/x86/kernel/cpu/perf_counter.c +++ b/arch/x86/kernel/cpu/perf_counter.c | |||
@@ -621,12 +621,13 @@ void perf_counter_print_debug(void) | |||
621 | { | 621 | { |
622 | u64 ctrl, status, overflow, pmc_ctrl, pmc_count, prev_left, fixed; | 622 | u64 ctrl, status, overflow, pmc_ctrl, pmc_count, prev_left, fixed; |
623 | struct cpu_hw_counters *cpuc; | 623 | struct cpu_hw_counters *cpuc; |
624 | unsigned long flags; | ||
624 | int cpu, idx; | 625 | int cpu, idx; |
625 | 626 | ||
626 | if (!x86_pmu.num_counters) | 627 | if (!x86_pmu.num_counters) |
627 | return; | 628 | return; |
628 | 629 | ||
629 | local_irq_disable(); | 630 | local_irq_save(flags); |
630 | 631 | ||
631 | cpu = smp_processor_id(); | 632 | cpu = smp_processor_id(); |
632 | cpuc = &per_cpu(cpu_hw_counters, cpu); | 633 | cpuc = &per_cpu(cpu_hw_counters, cpu); |
@@ -664,7 +665,7 @@ void perf_counter_print_debug(void) | |||
664 | pr_info("CPU#%d: fixed-PMC%d count: %016llx\n", | 665 | pr_info("CPU#%d: fixed-PMC%d count: %016llx\n", |
665 | cpu, idx, pmc_count); | 666 | cpu, idx, pmc_count); |
666 | } | 667 | } |
667 | local_irq_enable(); | 668 | local_irq_restore(flags); |
668 | } | 669 | } |
669 | 670 | ||
670 | static void x86_pmu_disable(struct perf_counter *counter) | 671 | static void x86_pmu_disable(struct perf_counter *counter) |