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-05-01 15:16:04 +02:00
2009-04-24 15:31:30 -07:00
2009-05-02 10:22:27 +02:00
2009-04-29 08:02:44 +02:00
2009-01-14 14:15:19 +01:00
2009-03-28 13:05:30 -07:00
2009-04-20 23:01:15 -04:00
2009-04-05 13:49:04 -04:00
2009-01-04 15:14:41 -05:00
2009-05-06 16:36:09 -07:00
2009-04-05 13:49:04 -04:00
2009-01-14 14:15:19 +01:00
2009-04-02 19:04:54 -07:00
2008-11-12 17:17:16 -08:00
2009-05-09 10:49:40 -04:00
2009-04-30 19:24:24 +02:00
2008-10-20 08:52:34 -07:00
2009-03-30 22:05:12 +10:30
2009-04-02 19:04:57 -07:00
2008-11-14 10:39:23 +11:00
2009-01-09 13:59:25 -08:00
2008-12-18 13:54:01 +01:00
2009-01-21 18:51:53 +09:00
2008-10-16 11:21:30 -07:00
2009-03-31 23:00:27 -04:00
2009-05-20 00:22:24 +02:00
2009-04-05 11:04:19 -07:00
2009-04-29 14:47:05 +02:00
2008-10-30 11:38:45 -07:00
2008-11-14 10:39:19 +11:00
2009-04-02 23:39:53 +02:00
2009-03-31 14:52:52 +02:00
2009-02-11 11:04:16 +01:00
2009-02-05 13:04:33 +01:00
2009-03-31 13:05:32 +10:30
2008-10-20 08:52:34 -07:00
2008-07-28 14:37:38 +02:00
2008-12-25 09:31:28 +01:00
2009-04-02 19:05:04 -07:00
2009-05-15 07:56:24 -05:00
2009-03-31 13:05:35 +10:30
2009-05-08 16:23:48 -07:00
2009-01-06 10:44:31 -08:00
2009-04-09 09:50:37 +09:30
2009-02-11 10:18:04 +01:00
2009-02-14 23:28:22 +01:00
2009-02-14 23:28:28 +01:00
2009-02-14 23:27:59 +01:00
2009-04-17 18:00:00 +02:00
2009-04-08 10:35:30 +02:00
2008-11-16 09:52:03 +01:00
2009-04-11 12:44:49 -07:00
2009-01-14 18:09:02 +01:00
2009-01-14 18:09:02 +01:00
2009-05-06 08:47:26 +02:00
2009-01-14 18:09:02 +01:00
2008-11-26 08:22:50 +01:00
2009-04-02 19:04:53 -07:00
2008-11-24 18:57:41 -05:00
2009-05-06 16:36:09 -07:00
2009-03-31 13:05:30 +10:30
2009-05-20 20:12:54 +02:00
2009-04-02 19:04:58 -07:00
2009-04-02 19:05:02 -07:00
2008-09-02 19:21:40 -07:00
2009-04-30 08:08:31 +02:00
2009-01-14 14:15:20 +01:00
2009-04-05 10:23:25 -07:00
2009-02-10 00:50:37 +01:00
2009-04-27 20:30:51 +10:00
2009-04-03 12:23:02 +02:00
2009-04-15 13:55:14 -07:00
2008-12-18 21:56:04 +01:00
2009-04-03 12:23:04 +02:00
2009-03-30 22:05:16 +10:30
2009-04-14 11:31:50 +02:00
2009-04-14 11:31:50 +02:00
2009-04-03 12:23:03 +02:00
2009-04-05 11:04:19 -07:00
2009-01-08 08:31:05 -08:00
2009-04-18 21:44:24 -07:00
2008-07-21 21:55:02 -07:00
2009-04-29 23:20:17 +02:00
2009-04-02 00:49:02 +02:00
2009-04-01 13:24:51 +02:00
2009-03-30 22:05:17 +10:30
2009-03-24 23:16:51 +01:00
2009-02-15 21:15:16 +01:00
2009-03-30 17:17:35 -07:00
2008-10-22 10:01:52 +02:00
2009-04-08 17:26:00 +02:00
2009-03-24 23:16:51 +01:00
2009-05-18 07:37:49 +02:00
2009-03-02 15:41:30 -08:00
2008-08-05 14:33:47 -07:00
2009-04-30 19:24:24 +02:00
2009-04-24 07:47:59 -07:00
2009-03-13 10:47:34 +01:00
2009-04-17 01:57:54 +02:00
2009-01-16 14:06:04 +01:00
2009-04-02 19:05:11 -07:00
2008-12-25 11:44:43 +01:00
2009-03-30 22:05:17 +10:30
2009-01-21 16:37:27 +01:00
2009-04-29 14:47:05 +02:00
2009-02-01 01:04:33 -08:00
2009-05-18 07:37:49 +02:00
2009-01-01 10:12:28 +10:30
2009-01-06 15:59:20 -08:00
2009-01-14 14:15:18 +01:00
2009-04-29 14:47:05 +02:00
2009-03-18 19:55:00 +01:00
2009-03-09 08:13:35 -07:00
2009-01-14 14:15:26 +01:00
2009-01-12 16:04:37 +01:00
2009-02-27 16:26:21 -08:00
2009-03-24 10:52:46 +11:00
2009-04-02 19:05:01 -07:00
2008-08-23 12:14:12 -07:00
2009-02-05 12:56:48 -08:00
2009-04-09 09:50:37 +09:30