Commit 5bb9efe3 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

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: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
parent e758a33d
...@@ -621,12 +621,13 @@ void perf_counter_print_debug(void) ...@@ -621,12 +621,13 @@ void perf_counter_print_debug(void)
{ {
u64 ctrl, status, overflow, pmc_ctrl, pmc_count, prev_left, fixed; u64 ctrl, status, overflow, pmc_ctrl, pmc_count, prev_left, fixed;
struct cpu_hw_counters *cpuc; struct cpu_hw_counters *cpuc;
unsigned long flags;
int cpu, idx; int cpu, idx;
if (!x86_pmu.num_counters) if (!x86_pmu.num_counters)
return; return;
local_irq_disable(); local_irq_save(flags);
cpu = smp_processor_id(); cpu = smp_processor_id();
cpuc = &per_cpu(cpu_hw_counters, cpu); cpuc = &per_cpu(cpu_hw_counters, cpu);
...@@ -664,7 +665,7 @@ void perf_counter_print_debug(void) ...@@ -664,7 +665,7 @@ void perf_counter_print_debug(void)
pr_info("CPU#%d: fixed-PMC%d count: %016llx\n", pr_info("CPU#%d: fixed-PMC%d count: %016llx\n",
cpu, idx, pmc_count); cpu, idx, pmc_count);
} }
local_irq_enable(); local_irq_restore(flags);
} }
static void x86_pmu_disable(struct perf_counter *counter) static void x86_pmu_disable(struct perf_counter *counter)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment