Jiri Olsa
06f417968b
perf: Remove WARN_ON_ONCE() check in __perf_event_enable() for valid scenario
The '!ctx->is_active' check has a valid scenario, so
there's no need for the warning.
The reason is that there's a time window between the
'ctx->is_active' check in the perf_event_enable() function
and the __perf_event_enable() function having:
- IRQs on
- ctx->lock unlocked
where the task could be killed and 'ctx' deactivated by
perf_event_exit_task(), ending up with the warning below.
So remove the WARN_ON_ONCE() check and add comments to
explain it all.
This addresses the following warning reported by Vince Weaver:
[ 324.983534] ------------[ cut here ]------------
[ 324.984420] WARNING: at kernel/events/core.c:1953 __perf_event_enable+0x187/0x190()
[ 324.984420] Modules linked in:
[ 324.984420] CPU: 19 PID: 2715 Comm: nmi_bug_snb Not tainted 3.10.0+ #246
[ 324.984420] Hardware name: Supermicro X8DTN/X8DTN, BIOS 4.6.3 01/08/2010
[ 324.984420] 0000000000000009 ffff88043fce3ec8 ffffffff8160ea0b ffff88043fce3f00
[ 324.984420] ffffffff81080ff0 ffff8802314fdc00 ffff880231a8f800 ffff88043fcf7860
[ 324.984420] 0000000000000286 ffff880231a8f800 ffff88043fce3f10 ffffffff8108103a
[ 324.984420] Call Trace:
[ 324.984420] <IRQ> [<ffffffff8160ea0b>] dump_stack+0x19/0x1b
[ 324.984420] [<ffffffff81080ff0>] warn_slowpath_common+0x70/0xa0
[ 324.984420] [<ffffffff8108103a>] warn_slowpath_null+0x1a/0x20
[ 324.984420] [<ffffffff81134437>] __perf_event_enable+0x187/0x190
[ 324.984420] [<ffffffff81130030>] remote_function+0x40/0x50
[ 324.984420] [<ffffffff810e51de>] generic_smp_call_function_single_interrupt+0xbe/0x130
[ 324.984420] [<ffffffff81066a47>] smp_call_function_single_interrupt+0x27/0x40
[ 324.984420] [<ffffffff8161fd2f>] call_function_single_interrupt+0x6f/0x80
[ 324.984420] <EOI> [<ffffffff816161a1>] ? _raw_spin_unlock_irqrestore+0x41/0x70
[ 324.984420] [<ffffffff8113799d>] perf_event_exit_task+0x14d/0x210
[ 324.984420] [<ffffffff810acd04>] ? switch_task_namespaces+0x24/0x60
[ 324.984420] [<ffffffff81086946>] do_exit+0x2b6/0xa40
[ 324.984420] [<ffffffff8161615c>] ? _raw_spin_unlock_irq+0x2c/0x30
[ 324.984420] [<ffffffff81087279>] do_group_exit+0x49/0xc0
[ 324.984420] [<ffffffff81096854>] get_signal_to_deliver+0x254/0x620
[ 324.984420] [<ffffffff81043057>] do_signal+0x57/0x5a0
[ 324.984420] [<ffffffff8161a164>] ? __do_page_fault+0x2a4/0x4e0
[ 324.984420] [<ffffffff8161665c>] ? retint_restore_args+0xe/0xe
[ 324.984420] [<ffffffff816166cd>] ? retint_signal+0x11/0x84
[ 324.984420] [<ffffffff81043605>] do_notify_resume+0x65/0x80
[ 324.984420] [<ffffffff81616702>] retint_signal+0x46/0x84
[ 324.984420] ---[ end trace 442ec2f04db3771a ]---
Reported-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Suggested-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: <stable@kernel.org>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1373384651-6109-2-git-send-email-jolsa@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2013-07-12 11:11:01 +02:00
..
2013-06-14 23:01:05 +02:00
2013-04-30 17:04:10 -07:00
2013-07-12 11:11:01 +02:00
2013-01-11 11:39:33 -08:00
2013-07-02 16:14:35 -07:00
2013-06-03 14:20:18 -07:00
2013-07-01 11:18:53 +02:00
2013-06-21 13:10:34 +02:00
2013-06-11 13:58:46 -04:00
2013-04-22 07:09:06 -07:00
2013-05-04 14:57:58 -04:00
2013-03-12 13:59:14 -07:00
2013-06-12 16:29:46 -07:00
2013-01-11 14:54:55 -08:00
2013-06-12 16:29:45 -07:00
2013-05-11 14:29:11 -07:00
2013-05-24 16:22:52 -07:00
2013-05-07 22:27:15 -04:00
2013-04-14 10:06:31 -07:00
2012-11-19 08:13:38 -08:00
2013-05-29 07:59:39 +09:00
2013-05-01 07:21:43 -07:00
2013-05-01 17:29:18 -04:00
2013-06-20 08:18:35 -10:00
2012-05-31 17:49:27 -07:00
2013-06-12 16:29:44 -07:00
2013-06-19 12:58:42 +02:00
2012-12-18 10:55:28 -08:00
2013-01-27 19:23:31 +01:00
2012-03-28 18:30:03 +01:00
2013-06-15 05:39:08 +04:00
2013-04-15 13:25:16 +02:00
2013-05-08 11:51:05 -07:00
2012-10-26 14:27:49 -07:00
2013-02-23 18:50:11 -08:00
2013-06-25 23:11:19 +02:00
2012-05-03 03:29:33 -07:00
2013-05-05 13:23:27 -07:00
2012-04-25 12:39:25 +02:00
2013-02-05 00:48:46 +01:00
2012-04-10 11:00:30 +02:00
2012-08-06 19:00:35 +03:00
2013-04-15 15:17:26 +09:30
2012-12-20 17:40:19 -08:00
2013-05-28 08:50:00 +02:00
2012-03-23 13:18:57 +01:00
2013-04-30 17:04:07 -07:00
2013-05-16 12:01:11 -07:00
2013-05-28 10:37:59 +02:00
2012-12-11 18:10:49 -08:00
2013-04-30 17:04:02 -07:00
2012-05-29 23:28:41 -04:00
2012-10-24 12:39:09 +02:00
2013-05-08 11:51:05 -07:00
2013-05-05 10:58:06 -07:00
2013-03-15 15:09:43 +10:30
2012-12-20 17:40:21 -08:00
2012-12-05 11:27:24 +10:30
2012-10-19 17:30:40 -07:00
2013-05-17 09:53:36 +01:00
2013-06-26 12:10:56 +02:00
2013-05-01 17:29:39 -04:00
2012-12-06 17:16:23 +08:00
2013-04-30 17:04:02 -07:00
2013-03-18 11:40:21 +00:00
2013-05-01 17:51:54 -07:00
2013-05-01 17:51:54 -07:00
2013-04-22 19:59:25 +02:00
2013-04-18 12:51:19 +02:00
2013-06-12 16:29:44 -07:00
2013-05-01 17:29:18 -04:00
2013-06-29 11:29:08 -07:00
2013-06-18 11:32:10 -05:00
2013-01-28 22:06:21 -08:00
2013-06-10 13:46:44 -07:00
2013-06-10 13:45:53 -07:00
2013-06-10 13:45:53 -07:00
2013-06-10 13:45:25 -07:00
2013-06-10 13:46:44 -07:00
2013-05-05 00:16:35 -04:00
2013-06-10 13:46:44 -07:00
2013-06-10 13:44:56 -07:00
2013-05-08 10:13:35 -07:00
2012-12-18 15:02:12 -08:00
2013-06-06 15:20:51 -07:00
2013-02-07 20:51:08 +01:00
2013-04-10 14:48:37 +02:00
2013-05-28 09:23:52 +02:00
2013-03-23 15:53:52 -07:00
2013-03-26 11:07:19 +11:00
2013-04-30 17:04:08 -07:00
2013-05-01 14:08:52 -07:00
2013-04-30 17:04:03 -07:00
2013-04-12 14:18:43 +02:00
2012-08-13 17:01:07 +02:00
2013-07-02 16:14:35 -07:00
2012-03-23 13:18:57 +01:00
2013-02-07 15:19:36 -08:00
2013-02-26 22:25:17 +01:00
2013-05-09 13:46:38 -04:00
2013-06-12 16:29:44 -07:00
2013-05-09 14:53:20 -04:00
2013-06-23 11:52:57 +02:00
2012-09-13 16:47:34 +02:00
2012-10-06 03:05:31 +09:00
2013-04-29 18:28:42 -07:00
2013-06-19 12:58:42 +02:00
2013-02-16 23:17:25 +01:00
2013-05-15 14:05:17 -07:00
2013-04-29 13:55:38 -07:00
2013-01-27 19:23:31 +01:00
2013-03-03 22:58:33 -05:00
2013-05-01 17:51:54 -07:00
2013-02-27 19:10:24 -08:00
2013-05-01 17:51:54 -07:00
2013-02-27 19:10:22 -08:00
2013-05-01 17:29:39 -04:00
2013-05-15 13:50:38 +01:00
2013-03-14 08:24:05 +01:00
2013-06-19 12:58:42 +02:00
2013-05-15 14:24:24 -07:00