Ingo Molnar
34adc80622
perf_counter: Fix context removal deadlock
Disable the PMU globally before removing a counter from a
context. This fixes the following lockup:
[22081.741922] ------------[ cut here ]------------
[22081.746668] WARNING: at arch/x86/kernel/cpu/perf_counter.c:803 intel_pmu_handle_irq+0x9b/0x24e()
[22081.755624] Hardware name: X8DTN
[22081.758903] perfcounters: irq loop stuck!
[22081.762985] Modules linked in:
[22081.766136] Pid: 11082, comm: perf Not tainted 2.6.30-rc6-tip #226
[22081.772432] Call Trace:
[22081.774940] <NMI> [<ffffffff81019aed>] ? intel_pmu_handle_irq+0x9b/0x24e
[22081.781993] [<ffffffff81019aed>] ? intel_pmu_handle_irq+0x9b/0x24e
[22081.788368] [<ffffffff8104505c>] ? warn_slowpath_common+0x77/0xa3
[22081.794649] [<ffffffff810450d3>] ? warn_slowpath_fmt+0x40/0x45
[22081.800696] [<ffffffff81019aed>] ? intel_pmu_handle_irq+0x9b/0x24e
[22081.807080] [<ffffffff814d1a72>] ? perf_counter_nmi_handler+0x3f/0x4a
[22081.813751] [<ffffffff814d2d09>] ? notifier_call_chain+0x58/0x86
[22081.819951] [<ffffffff8105b250>] ? notify_die+0x2d/0x32
[22081.825392] [<ffffffff814d1414>] ? do_nmi+0x8e/0x242
[22081.830538] [<ffffffff814d0f0a>] ? nmi+0x1a/0x20
[22081.835342] [<ffffffff8117e102>] ? selinux_file_free_security+0x0/0x1a
[22081.842105] [<ffffffff81018793>] ? x86_pmu_disable_counter+0x15/0x41
[22081.848673] <<EOE>> [<ffffffff81018f3d>] ? x86_pmu_disable+0x86/0x103
[22081.855512] [<ffffffff8108fedd>] ? __perf_counter_remove_from_context+0x0/0xfe
[22081.862926] [<ffffffff8108fcbc>] ? counter_sched_out+0x30/0xce
[22081.868909] [<ffffffff8108ff36>] ? __perf_counter_remove_from_context+0x59/0xfe
[22081.876382] [<ffffffff8106808a>] ? smp_call_function_single+0x6c/0xe6
[22081.882955] [<ffffffff81091b96>] ? perf_release+0x86/0x14c
[22081.888600] [<ffffffff810c4c84>] ? __fput+0xe7/0x195
[22081.893718] [<ffffffff810c213e>] ? filp_close+0x5b/0x62
[22081.899107] [<ffffffff81046a70>] ? put_files_struct+0x64/0xc2
[22081.905031] [<ffffffff8104841a>] ? do_exit+0x1e2/0x6ef
[22081.910360] [<ffffffff814d0a60>] ? _spin_lock_irqsave+0x9/0xe
[22081.916292] [<ffffffff8104898e>] ? do_group_exit+0x67/0x93
[22081.921953] [<ffffffff810489cc>] ? sys_exit_group+0x12/0x16
[22081.927759] [<ffffffff8100baab>] ? system_call_fastpath+0x16/0x1b
[22081.934076] ---[ end trace 3a3936ce3e1b4505 ]---
And could potentially also fix the lockup reported by Marcelo Tosatti.
Also, print more debug info in case of a detected lockup.
[ Impact: fix lockup ]
Reported-by: Marcelo Tosatti <mtosatti@redhat.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-05-20 20:12:54 +02:00
..
2009-04-05 02:14:15 -04:00
2009-04-29 14:47:05 +02:00
2009-05-20 20:12:54 +02:00
2009-03-10 16:24:23 +01:00
2009-05-04 15:05:24 +02:00
2009-04-03 10:36:57 -07:00
2008-11-28 15:24:39 +01:00
2009-03-31 13:33:50 +10:30
2009-04-01 08:59:16 -07:00
2009-04-01 08:59:16 -07:00
2009-04-03 19:25:57 +02:00
2009-03-15 07:03:15 +01:00
2009-01-03 12:04:39 -08:00
2008-10-20 08:52:39 -07:00
2008-10-20 08:52:39 -07:00
2009-02-17 17:52:44 +01:00
2008-10-13 10:33:15 +02:00
2009-03-06 16:13:15 +01:00
2008-12-03 08:56:25 +01:00
2009-01-19 00:38:58 +09:00
2009-03-30 14:04:53 +11:00
2008-12-03 08:56:25 +01:00
2009-05-07 21:42:39 -07:00
2009-03-13 02:37:18 +01:00
2009-01-09 12:46:22 -08:00
2008-08-18 08:50:19 +02:00
2009-03-27 17:28:43 +01:00
2009-02-25 08:27:46 +01:00
2009-02-24 18:08:40 +01:00
2009-03-27 17:28:43 +01:00
2009-03-14 09:42:51 +01:00
2009-04-29 14:47:05 +02:00
2009-04-09 05:43:32 +02:00
2009-03-14 17:23:47 -07:00
2009-03-14 15:37:14 -07:00
2009-03-17 11:52:10 -07:00
2009-02-24 18:08:38 +01:00
2008-12-12 11:08:42 +01:00
2009-04-22 15:53:40 +02:00
2008-10-20 18:27:03 +02:00
2009-03-04 20:33:16 +01:00
2009-02-10 13:13:23 +01:00
2009-04-21 13:41:47 -07:00
2009-02-23 00:08:11 +01:00
2008-12-31 18:07:42 -05:00
2009-03-21 16:57:04 +05:30
2009-03-02 12:07:48 +01:00
2009-02-24 21:52:45 +01:00
2009-02-09 12:16:05 +01:00
2009-04-29 14:47:05 +02:00
2009-04-07 10:48:56 +02:00
2009-04-07 10:48:56 +02:00
2008-10-28 17:10:27 +01:00
2009-03-21 16:55:45 +05:30
2009-05-15 07:56:25 -05:00
2009-04-02 00:49:02 +02:00
2009-03-19 14:04:19 +01:00
2009-04-21 13:41:47 -07:00
2009-01-02 17:46:24 +01:00
2009-05-07 22:01:05 -07:00
2009-05-07 22:01:05 -07:00
2009-04-02 00:49:02 +02:00
2009-02-23 00:08:11 +01:00
2009-03-30 22:05:14 +10:30
2009-03-18 13:51:17 +01:00
2009-04-17 09:56:11 -07:00
2009-03-18 13:51:17 +01:00
2009-03-12 13:13:07 +01:00
2009-01-12 11:22:55 +01:00
2009-01-12 11:23:01 +01:00
2009-04-12 12:32:18 +02:00
2009-01-12 11:22:50 +01:00
2009-02-14 23:05:25 +01:00
2009-01-30 14:51:44 -08:00
2009-01-30 14:51:44 -08:00
2009-01-20 17:14:28 +01:00
2009-03-19 14:04:19 +01:00
2009-01-06 14:06:57 +01:00
2009-04-07 08:31:12 -07:00
2009-03-05 12:47:28 +01:00
2009-04-07 08:31:11 -07:00
2009-04-14 02:51:04 +02:00
2008-09-22 12:58:36 +02:00
2009-01-29 14:16:51 +01:00
2009-04-02 19:04:51 -07:00
2009-04-02 19:04:51 -07:00
2009-04-05 11:04:19 -07:00
2009-04-09 05:43:32 +02:00
2008-10-15 14:25:14 +02:00
2009-04-24 08:41:39 +02:00
2009-04-08 17:53:27 +02:00
2009-03-10 18:13:25 -07:00
2009-03-10 18:13:25 -07:00
2009-03-21 16:56:37 +05:30
2009-04-02 06:08:05 +02:00
2009-03-30 18:00:26 -07:00
2009-04-06 09:30:36 +02:00
2009-02-17 17:52:44 +01:00
2009-03-13 14:49:54 +10:30
2009-01-31 04:21:18 +01:00
Merge branches 'x86/alternatives', 'x86/cleanups', 'x86/commandline', 'x86/crashdump', 'x86/debug', 'x86/defconfig', 'x86/doc', 'x86/exports', 'x86/fpu', 'x86/gart', 'x86/idle', 'x86/mm', 'x86/mtrr', 'x86/nmi-watchdog', 'x86/oprofile', 'x86/paravirt', 'x86/reboot', 'x86/sparse-fixes', 'x86/tsc', 'x86/urgent' and 'x86/vmalloc' into x86-v28-for-linus-phase1
2008-10-06 18:17:07 +02:00
2008-10-22 22:55:23 -07:00
2009-04-30 21:16:49 +02:00
2009-02-23 00:08:11 +01:00
2009-03-30 22:05:14 +10:30
2009-04-16 16:43:20 -07:00
2009-03-21 16:55:24 +05:30
2009-02-13 11:35:01 -08:00
2009-02-13 11:35:01 -08:00
2008-12-08 13:49:45 +01:00
2009-04-06 09:02:57 +02:00
Merge branches 'x86/apic', 'x86/cleanups', 'x86/cpufeature', 'x86/crashdump', 'x86/debug', 'x86/defconfig', 'x86/detect-hyper', 'x86/doc', 'x86/dumpstack', 'x86/early-printk', 'x86/fpu', 'x86/idle', 'x86/io', 'x86/memory-corruption-check', 'x86/microcode', 'x86/mm', 'x86/mtrr', 'x86/nmi-watchdog', 'x86/pat2', 'x86/pci-ioapic-boot-irq-quirks', 'x86/ptrace', 'x86/quirks', 'x86/reboot', 'x86/setup-memory', 'x86/signal', 'x86/sparse-fixes', 'x86/time', 'x86/uv' and 'x86/xen' into x86/core
2008-12-23 16:27:23 +01:00
2009-04-21 13:41:47 -07:00
2009-02-17 17:52:44 +01:00
2009-04-08 14:58:10 +02:00
2009-04-22 17:41:25 +02:00
2009-03-11 09:49:01 +01:00
2009-02-11 14:00:56 -08:00
2009-03-19 14:04:19 +01:00
2009-04-21 13:41:47 -07:00
2009-03-17 14:16:02 -07:00
2009-03-17 12:58:15 -07:00
2009-03-25 21:34:28 +01:00
2008-12-28 12:21:10 -08:00
2009-01-16 14:20:22 +01:00
2009-04-20 14:33:00 -07:00