Frederic Weisbecker
07695fa04e
tracing/ftrace: fix a race condition in sched_switch tracer
...
Impact: fix race condition in sched_switch tracer
This patch fixes a race condition in the sched_switch tracer. If
several tasks (IE: concurrent initcalls) are playing with
tracing_start_cmdline_record() and tracing_stop_cmdline_record(), the
following situation could happen:
_ Task A and B are using the same tracepoint probe. Task A holds it.
Task B is sleeping and doesn't hold it.
_ Task A frees the sched tracer, then sched_ref is decremented to 0.
_ Task A is preempted and hadn't yet unregistered its tracepoint
probe, then B runs.
_ B increments sched_ref, sees it's 1 and then guess it has to
register its probe. But it has not been freed by task A.
_ A lot of bad things can happen after that...
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com >
Signed-off-by: Ingo Molnar <mingo@elte.hu >
2008-11-04 17:14:04 +01:00
..
2008-10-22 07:37:17 +02:00
2008-11-01 12:40:38 -07:00
2008-10-22 09:48:06 +02:00
2008-11-04 17:14:04 +01:00
2008-10-13 09:51:42 -07:00
2008-10-23 05:12:53 -04:00
2008-08-01 12:15:16 -04:00
2008-08-01 12:15:03 -04:00
2008-10-13 09:51:42 -07:00
2008-08-14 22:59:43 +10:00
2008-10-20 08:52:38 -07:00
2008-10-30 11:38:45 -07:00
2008-10-26 09:38:17 -07:00
2008-10-20 13:14:06 +02:00
2008-10-20 08:52:34 -07:00
2008-10-08 11:31:02 +02:00
2008-10-20 08:52:39 -07:00
2008-08-22 08:34:53 +02:00
2008-10-16 11:21:30 -07:00
2008-10-23 14:30:41 +04:00
2008-10-20 13:35:07 -07:00
2008-10-22 09:48:06 +02:00
2008-10-30 11:38:45 -07:00
2008-09-11 07:17:00 -07:00
2008-10-22 09:48:06 +02:00
2008-09-14 16:25:35 +02:00
2008-10-16 11:21:32 -07:00
2008-10-20 08:52:34 -07:00
2008-07-28 14:37:38 +02:00
2008-10-20 15:28:50 -07:00
2008-10-06 13:50:59 -05:00
2008-10-16 12:38:34 -07:00
2008-10-16 11:21:52 -07:00
2008-10-16 11:21:31 -07:00
2008-10-20 13:35:07 -07:00
2008-08-13 12:55:10 +02:00
2008-08-26 10:37:46 +02:00
2008-10-28 11:19:07 +01:00
2008-10-22 09:08:14 +02:00
2008-10-27 13:02:23 +01:00
2008-10-23 12:04:37 -07:00
2008-07-28 18:12:36 +02:00
2008-10-14 10:34:22 +02:00
2008-08-23 12:14:12 -07:00
2008-10-22 10:00:25 +11:00
2008-10-23 12:09:00 -07:00
2008-09-02 19:21:38 -07:00
2008-09-02 19:21:40 -07:00
2008-09-23 13:38:44 +02:00
2008-10-22 09:48:06 +02:00
2008-10-23 21:54:29 +02:00
2008-10-30 11:38:46 -07:00
2008-10-20 08:52:39 -07:00
2008-10-03 10:41:00 +02:00
2008-10-21 15:59:53 +02:00
2008-08-15 17:54:40 +02:00
2008-10-20 08:52:40 -07:00
2008-10-20 12:51:53 -07:00
2008-08-05 14:33:46 -07:00
2008-11-01 09:53:58 -07:00
2008-09-05 21:35:13 -07:00
2008-10-10 11:17:04 +02:00
2008-10-30 11:37:57 +01:00
2008-10-24 12:51:03 +02:00
2008-10-20 14:27:43 +02:00
2008-10-22 10:01:52 +02:00
2008-10-24 12:48:46 +02:00
2008-10-23 12:04:37 -07:00
2008-10-24 12:51:03 +02:00
2008-08-05 14:33:47 -07:00
2008-10-30 11:38:46 -07:00
2008-08-25 17:45:48 -07:00
2008-10-20 13:14:06 +02:00
2008-10-16 11:21:31 -07:00
2008-08-13 13:56:51 +02:00
2008-10-25 19:53:38 -07:00
2008-10-16 11:21:51 -07:00
2008-10-22 09:48:06 +02:00
2008-10-31 00:38:21 +01:00
2008-09-05 21:34:57 -07:00
2008-10-20 13:14:06 +02:00
2008-11-03 10:28:52 +01:00
2008-07-27 16:12:28 -07:00
2008-08-23 12:14:12 -07:00
2008-08-19 13:10:09 +02:00
2008-10-16 11:21:47 -07:00
2008-08-23 12:14:12 -07:00
2008-10-16 11:21:31 -07:00
2008-10-22 10:00:25 +11:00