Peter Zijlstra
ab711fe082
perf: Fix task context scheduling
...
Jiri reported:
|
| - once an event is created by sys_perf_event_open, task context
| is created and it stays even if the event is closed, until the
| task is finished ... thats what I see in code and I assume it's
| correct
|
| - when the task opens event, perf_sched_events jump label is
| incremented and following callbacks are started from scheduler
|
| __perf_event_task_sched_in
| __perf_event_task_sched_out
|
| These callback *in/out set/unset cpuctx->task_ctx value to the
| task context.
|
| - close is called on event on CPU 0:
| - the task is scheduled on CPU 0
| - __perf_event_task_sched_in is called
| - cpuctx->task_ctx is set
| - perf_sched_events jump label is decremented and == 0
| - __perf_event_task_sched_out is not called
| - cpuctx->task_ctx on CPU 0 stays set
|
| - exit is called on CPU 1:
| - the task is scheduled on CPU 1
| - perf_event_exit_task is called
| - task_ctx_sched_out unsets cpuctx->task_ctx on CPU 1
| - put_ctx destroys the context
|
| - another call of perf_rotate_context on CPU 0 will use invalid
| task_ctx pointer, and eventualy panic.
|
Cure this the simplest possibly way by partially reverting the
jump_label optimization for the sched_out case.
Reported-and-tested-by: Jiri Olsa <jolsa@redhat.com >
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl >
Cc: Oleg Nesterov <oleg@redhat.com >
Cc: <stable@kernel.org > # .37+
LKML-Reference: <1301520405.4859.213.camel@twins>
Signed-off-by: Ingo Molnar <mingo@elte.hu >
2011-03-31 13:02:55 +02:00
..
2011-03-20 09:32:12 +00:00
2011-03-27 23:34:59 -07:00
2011-03-22 11:33:55 -07:00
2011-03-23 10:42:00 +01:00
2011-03-18 23:38:50 -07:00
2011-03-29 12:09:30 -07:00
2011-03-23 12:24:23 -07:00
2011-03-26 15:58:50 -04:00
2011-03-25 17:41:20 +02:00
2011-03-20 15:33:26 +01:00
2011-03-16 15:11:04 -07:00
2011-03-01 22:24:19 +03:00
2011-03-26 14:15:06 +00:00
2011-03-19 22:27:06 -07:00
2011-03-24 13:52:42 -04:00
2011-03-16 15:11:04 -07:00
2011-02-24 19:58:42 +01:00
2011-03-21 22:59:08 -04:00
2011-03-15 02:42:32 -04:00
2011-03-10 08:52:07 +01:00
2011-03-22 17:43:59 -07:00
2011-03-11 14:25:50 +00:00
2011-03-08 08:28:01 +01:00
2011-03-10 08:52:27 +01:00
2011-03-11 20:17:08 +01:00
2011-03-03 10:53:20 -05:00
2011-03-23 19:47:19 -07:00
2011-03-10 08:52:07 +01:00
2011-03-23 19:47:06 -07:00
2011-03-22 17:44:00 -07:00
2011-03-22 17:44:10 -07:00
2011-03-22 17:44:10 -07:00
2011-03-22 17:44:10 -07:00
2011-02-23 13:22:26 -08:00
2011-03-21 22:59:08 -04:00
2011-03-16 17:54:33 -04:00
2011-03-22 17:44:15 -07:00
2011-03-23 19:47:02 -07:00
2011-03-22 19:25:05 -07:00
2011-03-21 12:13:10 -04:00
2011-03-14 17:02:43 -07:00
2011-03-08 16:10:38 +01:00
2011-03-10 08:52:07 +01:00
2011-03-23 22:16:41 +01:00
2011-03-24 13:54:30 +00:00
2011-02-25 12:00:34 -08:00
2011-03-10 11:45:31 +01:00
2011-03-10 11:35:17 +01:00
2011-03-10 11:35:15 +01:00
2011-03-10 11:48:15 +01:00
2011-03-07 01:12:28 +05:30
2011-03-14 08:40:51 -07:00
2011-03-21 10:14:27 +01:00
2011-03-22 17:44:11 -07:00
2011-03-27 23:35:24 -07:00
2011-03-15 02:21:37 -04:00
2011-03-23 19:46:17 -07:00
2011-03-17 09:19:20 +08:00
2011-03-14 19:12:20 -04:00
2011-03-15 02:21:45 -04:00
2011-03-21 10:05:22 -07:00
2011-03-28 15:31:05 -07:00
2011-03-10 10:31:48 -05:00
2011-03-22 08:35:35 +01:00
2011-03-22 17:44:05 -07:00
2011-03-05 10:56:00 +01:00
2011-03-17 14:31:46 +01:00
2011-03-10 19:15:58 +01:00
2011-02-23 00:53:26 +00:00
2011-03-20 14:50:53 +01:00
2011-03-12 15:08:54 -08:00
2011-03-09 16:10:56 -05:00
2011-03-18 15:14:45 -07:00
2011-02-27 16:11:51 -08:00
2011-03-10 16:37:26 -08:00
2011-03-28 06:05:21 -04:00
2011-03-15 19:23:40 -07:00
2011-03-23 19:47:08 -07:00
2011-03-29 14:50:32 +02:00
2011-03-29 14:48:19 +02:00
2011-03-20 21:13:43 -04:00
2011-03-20 20:08:48 -04:00
2011-03-24 08:36:10 +01:00
2011-03-22 16:17:32 -07:00
2011-03-22 04:53:54 -03:00
2011-03-22 17:44:14 -07:00
2011-03-08 11:17:18 +11:00
2011-03-08 11:17:18 +11:00
2011-03-08 11:17:22 +11:00
2011-03-18 16:54:31 +00:00
2011-03-22 17:44:01 -07:00
2011-03-17 13:08:30 -03:00
2011-03-22 17:43:59 -07:00
2011-03-25 21:00:29 -07:00
2011-03-14 02:52:41 -04:00
2011-03-18 22:33:38 -07:00
2011-03-22 04:53:56 -03:00
2011-03-23 19:46:25 -07:00
2011-03-22 17:44:03 -07:00
2011-03-24 17:49:37 -07:00
2011-03-02 13:43:15 -08:00
2011-03-18 09:04:20 -04:00
2011-02-22 10:19:31 -08:00
2011-03-16 12:53:54 -07:00
2011-03-03 13:32:07 -08:00
2011-03-24 17:03:14 -04:00
2011-03-11 15:39:27 -05:00
2011-03-23 15:29:04 -04:00
2011-03-11 15:39:26 -05:00
2011-03-11 15:38:44 -05:00
2011-03-27 17:48:07 +02:00
2011-03-24 17:03:14 -04:00
2011-03-10 17:29:40 +09:00
2011-03-01 13:48:21 -05:00
2011-02-28 01:36:38 -07:00
2011-03-23 14:55:56 -06:00
2011-03-16 17:28:10 -07:00
2011-03-22 04:53:46 -03:00
2011-03-23 19:46:28 -07:00
2011-03-22 17:44:03 -07:00
2011-03-24 10:16:26 -07:00
2011-03-14 02:58:03 -04:00
2011-03-23 10:42:08 +01:00
2011-03-21 09:40:43 -07:00
2011-03-21 09:38:02 -07:00
2011-02-28 11:20:03 +01:00
2011-03-31 13:02:55 +02:00
2011-03-09 11:59:33 -08:00
2011-03-23 19:46:57 -07:00
2011-02-24 22:11:56 -08:00
2011-03-11 15:13:26 -05:00
2011-03-15 00:43:14 +01:00
2011-03-15 00:43:14 +01:00
2011-03-23 22:16:41 +01:00
2011-03-01 22:27:26 +03:00
2011-03-23 19:46:37 -07:00
2011-03-04 09:23:30 -08:00
2011-03-22 17:44:00 -07:00
2011-03-24 21:16:31 -04:00
2011-03-23 19:46:18 -07:00
2011-03-23 19:46:23 -07:00
2011-03-09 13:52:27 -05:00
2011-03-23 19:46:41 -07:00
2011-02-25 15:07:37 -08:00
2011-03-23 19:46:43 -07:00
2011-03-22 17:44:03 -07:00
2011-03-09 11:23:37 -08:00
2011-03-25 17:59:38 -07:00
2011-03-23 19:47:02 -07:00
2011-03-22 17:44:15 -07:00
2011-03-28 22:26:32 -07:00
2011-03-22 20:48:04 +02:00
2011-03-22 17:16:34 +09:00
2011-03-23 07:48:42 -07:00
2011-03-09 14:08:09 -08:00
2011-03-28 06:05:24 -04:00
2011-03-15 00:43:16 +01:00
2011-03-22 15:47:22 +09:00
2011-03-24 10:16:26 -07:00
2011-03-21 00:40:29 -04:00
2011-03-15 00:43:46 +01:00
2011-03-09 16:43:24 -08:00
2011-03-23 22:16:41 +01:00
2011-02-28 18:00:31 -08:00
2011-03-13 16:35:18 -04:00
2011-02-23 18:05:11 -05:00
2011-03-22 16:17:32 -07:00
2011-03-22 17:44:09 -07:00
2011-03-23 19:47:03 -07:00
2011-03-22 04:53:37 -03:00
2011-03-22 04:53:33 -03:00
2011-03-22 04:54:51 -03:00
2011-03-28 12:53:29 +01:00
2011-03-22 17:44:05 -07:00
2011-03-24 21:17:51 -04:00
2011-03-13 20:22:28 -07:00
2011-03-22 17:44:17 -07:00