<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/trace/ring_buffer.c, branch v2.6.33</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/kernel/trace/ring_buffer.c?h=v2.6.33</id>
<link rel='self' href='https://git.amat.us/linux/atom/kernel/trace/ring_buffer.c?h=v2.6.33'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2010-01-26T21:14:08Z</updated>
<entry>
<title>ring-buffer: Check for end of page in iterator</title>
<updated>2010-01-26T21:14:08Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2010-01-26T21:14:08Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3c05d7482777f15e71bb4cb1ba78dee2800dfec6'/>
<id>urn:sha1:3c05d7482777f15e71bb4cb1ba78dee2800dfec6</id>
<content type='text'>
If the iterator comes to an empty page for some reason, or if
the page is emptied by a consuming read. The iterator code currently
does not check if the iterator is pass the contents, and may
return a false entry.

This patch adds a check to the ring buffer iterator to test if the
current page has been completely read and sets the iterator to the
next page if necessary.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ring-buffer: Check if ring buffer iterator has stale data</title>
<updated>2010-01-26T21:09:30Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2010-01-25T20:17:47Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=492a74f4210e15f4701422e2e1c4cd3c1e45ddae'/>
<id>urn:sha1:492a74f4210e15f4701422e2e1c4cd3c1e45ddae</id>
<content type='text'>
Usually reads of the ring buffer is performed by a single task.
There are two types of reads from the ring buffer.

One is a consuming read which will consume the entry that was read
and the next read will be the entry that follows.

The other is an iterator that will let the user read the contents of
the ring buffer without modifying it. When an iterator is allocated,
writes to the ring buffer are disabled to protect the iterator.

The problem exists when consuming reads happen while an iterator is
allocated. Specifically, the kind of read that swaps out an entire
page (used by splice) and replaces it with a new read. If the iterator
is on the page that is swapped out, then the next read may read
from this swapped out page and return garbage.

This patch adds a check when reading the iterator to make sure that
the iterator contents are still valid. If a consuming read has taken
place, the iterator is reset.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ring-buffer: Add rb_list_head() wrapper around new reader page next field</title>
<updated>2010-01-07T01:40:44Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2010-01-07T01:40:44Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0e1ff5d72a6393f2ef5dbf74f58bb55a12d63834'/>
<id>urn:sha1:0e1ff5d72a6393f2ef5dbf74f58bb55a12d63834</id>
<content type='text'>
If the very unlikely case happens where the writer moves the head by one
between where the head page is read and where the new reader page
is assigned _and_ the writer then writes and wraps the entire ring buffer
so that the head page is back to what was originally read as the head page,
the page to be swapped will have a corrupted next pointer.

Simple solution is to wrap the assignment of the next pointer with a
rb_list_head().

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ring-buffer: Wrap a list.next reference with rb_list_head()</title>
<updated>2010-01-07T01:38:25Z</updated>
<author>
<name>David Sharp</name>
<email>dhsharp@google.com</email>
</author>
<published>2010-01-07T01:12:07Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5ded3dc6a3c7549b36a8ac27bbd81b33756a2c29'/>
<id>urn:sha1:5ded3dc6a3c7549b36a8ac27bbd81b33756a2c29</id>
<content type='text'>
This reference at the end of rb_get_reader_page() was causing off-by-one
writes to the prev pointer of the page after the reader page when that
page is the head page, and therefore the reader page has the RB_PAGE_HEAD
flag in its list.next pointer. This eventually results in a GPF in a
subsequent call to rb_set_head_page() (usually from rb_get_reader_page())
when that prev pointer is dereferenced. The dereferenced register would
characteristically have an address that appears shifted left by one byte
(eg, ffxxxxxxxxxxxxyy instead of ffffxxxxxxxxxxxx) due to being written at
an address one byte too high.

Signed-off-by: David Sharp &lt;dhsharp@google.com&gt;
LKML-Reference: &lt;1262826727-9090-1-git-send-email-dhsharp@google.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip</title>
<updated>2009-12-16T20:02:25Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2009-12-16T20:02:25Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=da184a8064efe2a78d8542877970f7c6bb62775a'/>
<id>urn:sha1:da184a8064efe2a78d8542877970f7c6bb62775a</id>
<content type='text'>
* 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  tracing: Fix return of trace_dump_stack()
  ksym_tracer: Fix bad cast
  tracing/power: Remove two exports
  tracing: Change event-&gt;profile_count to be int type
  tracing: Simplify trace_option_write()
  tracing: Remove useless trace option
  tracing: Use seq file for trace_clock
  tracing: Use seq file for trace_options
  function-graph: Allow writing the same val to set_graph_function
  ftrace: Call trace_parser_clear() properly
  ftrace: Return EINVAL when writing invalid val to set_ftrace_filter
  tracing: Move a printk out of ftrace_raw_reg_event_foo()
  tracing: Pull up calls to trace_define_common_fields()
  tracing: Extract duplicate ftrace_raw_init_event_foo()
  ftrace.h: Use common pr_info fmt string
  tracing: Add stack trace to irqsoff tracer
  tracing: Add trace_dump_stack()
  ring-buffer: Move resize integrity check under reader lock
  ring-buffer: Use sync sched protection on ring buffer resizing
  tracing: Fix wrong usage of strstrip in trace_ksyms
</content>
</entry>
<entry>
<title>locking: Convert __raw_spin* functions to arch_spin*</title>
<updated>2009-12-14T22:55:32Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2009-12-02T19:01:25Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0199c4e68d1f02894bdefe4b5d9e9ee4aedd8d62'/>
<id>urn:sha1:0199c4e68d1f02894bdefe4b5d9e9ee4aedd8d62</id>
<content type='text'>
Name space cleanup. No functional change.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Acked-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: linux-arch@vger.kernel.org
</content>
</entry>
<entry>
<title>locking: Rename __RAW_SPIN_LOCK_UNLOCKED to __ARCH_SPIN_LOCK_UNLOCKED</title>
<updated>2009-12-14T22:55:32Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2009-12-03T11:38:57Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=edc35bd72e2079b25f99c5da7d7a65dbbffc4a26'/>
<id>urn:sha1:edc35bd72e2079b25f99c5da7d7a65dbbffc4a26</id>
<content type='text'>
Further name space cleanup. No functional change

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Acked-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: linux-arch@vger.kernel.org
</content>
</entry>
<entry>
<title>locking: Convert raw_spinlock to arch_spinlock</title>
<updated>2009-12-14T22:55:32Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2009-12-02T18:49:50Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=445c89514be242b1b0080056d50bdc1b72adeb5c'/>
<id>urn:sha1:445c89514be242b1b0080056d50bdc1b72adeb5c</id>
<content type='text'>
The raw_spin* namespace was taken by lockdep for the architecture
specific implementations. raw_spin_* would be the ideal name space for
the spinlocks which are not converted to sleeping locks in preempt-rt.

Linus suggested to convert the raw_ to arch_ locks and cleanup the
name space instead of using an artifical name like core_spin,
atomic_spin or whatever

No functional change.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Acked-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: linux-arch@vger.kernel.org

</content>
</entry>
<entry>
<title>ring-buffer: Move resize integrity check under reader lock</title>
<updated>2009-12-11T04:20:52Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-12-11T04:20:52Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=dd7f59435782a02ceb6d16b9ce823dd3345d75ec'/>
<id>urn:sha1:dd7f59435782a02ceb6d16b9ce823dd3345d75ec</id>
<content type='text'>
While using an application that does splice on the ftrace ring
buffer at start up, I triggered an integrity check failure.

Looking into this, I discovered that resizing the buffer performs
an integrity check after the buffer is resized. This check unfortunately
is preformed after it releases the reader lock. If a reader is
reading the buffer it may cause the integrity check to trigger a
false failure.

This patch simply moves the integrity checker under the protection
of the ring buffer reader lock.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ring-buffer: Use sync sched protection on ring buffer resizing</title>
<updated>2009-12-11T03:54:27Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-12-11T03:54:27Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=184210154b9aa570099183f6c062ac4eb11190b7'/>
<id>urn:sha1:184210154b9aa570099183f6c062ac4eb11190b7</id>
<content type='text'>
There was a comment in the ring buffer code that says the calling
layers should prevent tracing or reading of the ring buffer while
resizing. I have discovered that the tracers do not honor this
arrangement.

This patch moves the disabling and synchronizing the ring buffer to
a higher layer during resizing. This guarantees that no writes
are occurring while the resize takes place.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
</feed>
