]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: fix trace_wait to know to wait on all cpus or just one
authorSteven Rostedt <srostedt@redhat.com>
Wed, 11 Mar 2009 23:52:30 +0000 (19:52 -0400)
committerSteven Rostedt <srostedt@redhat.com>
Thu, 12 Mar 2009 02:15:25 +0000 (22:15 -0400)
commitdcfce64dbbf19bf33f44c41d6d57b994d7947369
tree97df44bc298fe40719d6f08000d96532d3ecf27e
parent82dbebb8e0cb84bf35b2dfb6286b634292bb61ab
tracing: fix trace_wait to know to wait on all cpus or just one

Impact: fix to task live locking on reading trace_pipe on one CPU

The same code is used for both trace_pipe (all CPUS) and the per_cpu
trace_pipe file. When there is no data to read, it will check for
signals and wait on the trace wait queue.

The problem happens with the per_cpu wait. The trace_wait code checks
all CPUs. Thus, if there's data in another CPU buffer, then it will
exit the wait, without checking for signals or waiting on the wait queue.

It would then try to read the empty buffer, and since that will just
return nothing, then it will try to wait again. Unfortunately, that will
again fail due to there still being data in the other buffers. This
ends up with a live lock for the task.

This patch fixes the trace_wait to be aware that the iterator may only
be waiting on a single buffer.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
kernel/trace/trace.c