Skip to content

Commit

Permalink
perf_counter: fix print debug irq disable
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed May 13, 2009
1 parent e758a33 commit 5bb9efe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/x86/kernel/cpu/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,12 +621,13 @@ void perf_counter_print_debug(void)
{
u64 ctrl, status, overflow, pmc_ctrl, pmc_count, prev_left, fixed;
struct cpu_hw_counters *cpuc;
unsigned long flags;
int cpu, idx;

if (!x86_pmu.num_counters)
return;

local_irq_disable();
local_irq_save(flags);

cpu = smp_processor_id();
cpuc = &per_cpu(cpu_hw_counters, cpu);
Expand Down Expand Up @@ -664,7 +665,7 @@ void perf_counter_print_debug(void)
pr_info("CPU#%d: fixed-PMC%d count: %016llx\n",
cpu, idx, pmc_count);
}
local_irq_enable();
local_irq_restore(flags);
}

static void x86_pmu_disable(struct perf_counter *counter)
Expand Down

0 comments on commit 5bb9efe

Please sign in to comment.