<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/oprofile/event_buffer.c, branch v3.10.42</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>locking, oprofile: Annotate oprofilefs lock as raw</title>
<updated>2011-09-13T09:12:05+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2009-07-25T14:18:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2d21a29fb62f142b8a62496700d8d82a6a8fd783'/>
<id>2d21a29fb62f142b8a62496700d8d82a6a8fd783</id>
<content type='text'>
The oprofilefs_lock can be taken in atomic context (in profiling
interrupts) and therefore cannot cannot be preempted on -rt -
annotate it.

In mainline this change documents the low level nature of
the lock - otherwise there's no functional difference. Lockdep
and Sparse checking will work as usual.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The oprofilefs_lock can be taken in atomic context (in profiling
interrupts) and therefore cannot cannot be preempted on -rt -
annotate it.

In mainline this change documents the low level nature of
the lock - otherwise there's no functional difference. Lockdep
and Sparse checking will work as usual.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>oprofile: make event buffer nonseekable</title>
<updated>2010-07-26T08:58:24+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2010-07-07T21:40:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=729419f0090601406abe714c5f8872a3bd53ff68'/>
<id>729419f0090601406abe714c5f8872a3bd53ff68</id>
<content type='text'>
The event buffer cannot deal with seeks, so
we should forbid that outright.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Robert Richter &lt;robert.richter@amd.com&gt;
Cc: oprofile-list@lists.sf.net
Signed-off-by: Robert Richter &lt;robert.richter@amd.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The event buffer cannot deal with seeks, so
we should forbid that outright.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Robert Richter &lt;robert.richter@amd.com&gt;
Cc: oprofile-list@lists.sf.net
Signed-off-by: Robert Richter &lt;robert.richter@amd.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>oprofile: warn on freeing event buffer too early</title>
<updated>2009-10-09T19:32:05+00:00</updated>
<author>
<name>Robert Richter</name>
<email>robert.richter@amd.com</email>
</author>
<published>2009-10-09T01:17:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c0868934e536e0ff508f2d359d006b25abc4970d'/>
<id>c0868934e536e0ff508f2d359d006b25abc4970d</id>
<content type='text'>
A race shouldn't happen since all workqueues or handlers are canceled
or flushed before the event buffer is freed. A warning is triggered
now if the buffer is freed too early.

Also, this patch adds some comments about event buffer protection,
reworks some code and adds code to clear buffer_pos during alloc and
free of the event buffer.

Cc: David Rientjes &lt;rientjes@google.com&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Signed-off-by: Robert Richter &lt;robert.richter@amd.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A race shouldn't happen since all workqueues or handlers are canceled
or flushed before the event buffer is freed. A warning is triggered
now if the buffer is freed too early.

Also, this patch adds some comments about event buffer protection,
reworks some code and adds code to clear buffer_pos during alloc and
free of the event buffer.

Cc: David Rientjes &lt;rientjes@google.com&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Signed-off-by: Robert Richter &lt;robert.richter@amd.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>oprofile: fix race condition in event_buffer free</title>
<updated>2009-10-09T16:02:01+00:00</updated>
<author>
<name>David Rientjes</name>
<email>rientjes@google.com</email>
</author>
<published>2009-09-09T13:02:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=066b3aa8454bee3cdc665d86b5de812d8d0513b3'/>
<id>066b3aa8454bee3cdc665d86b5de812d8d0513b3</id>
<content type='text'>
Looking at the 2.6.31-rc9 code, it appears there is a race condition
in the event_buffer cleanup code path (shutdown). This could lead to
kernel panic as some CPUs may be operating on the event buffer AFTER
it has been freed. The attached patch solves the problem and makes
sure CPUs check if the buffer is not NULL before they access it as
some may have been spinning on the mutex while the buffer was being
freed.

The race may happen if the buffer is freed during pending reads. But
it is not clear why there are races in add_event_entry() since all
workqueues or handlers are canceled or flushed before the event buffer
is freed.

Signed-off-by: David Rientjes &lt;rientjes@google.com&gt;
Signed-off-by: Stephane Eranian &lt;eranian@google.com&gt;
Signed-off-by: Robert Richter &lt;robert.richter@amd.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Looking at the 2.6.31-rc9 code, it appears there is a race condition
in the event_buffer cleanup code path (shutdown). This could lead to
kernel panic as some CPUs may be operating on the event buffer AFTER
it has been freed. The attached patch solves the problem and makes
sure CPUs check if the buffer is not NULL before they access it as
some may have been spinning on the mutex while the buffer was being
freed.

The race may happen if the buffer is freed during pending reads. But
it is not clear why there are races in add_event_entry() since all
workqueues or handlers are canceled or flushed before the event buffer
is freed.

Signed-off-by: David Rientjes &lt;rientjes@google.com&gt;
Signed-off-by: Stephane Eranian &lt;eranian@google.com&gt;
Signed-off-by: Robert Richter &lt;robert.richter@amd.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>oprofile: rename kernel-wide identifiers</title>
<updated>2008-12-16T16:52:49+00:00</updated>
<author>
<name>Robert Richter</name>
<email>robert.richter@amd.com</email>
</author>
<published>2008-12-16T15:19:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=bd2172f58094b3f8afa017e68f3f0b57577824e1'/>
<id>bd2172f58094b3f8afa017e68f3f0b57577824e1</id>
<content type='text'>
This patch renames kernel-wide identifiers to something more oprofile
specific names.

Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Robert Richter &lt;robert.richter@amd.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch renames kernel-wide identifiers to something more oprofile
specific names.

Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Robert Richter &lt;robert.richter@amd.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>oprofile: fix memory ordering</title>
<updated>2008-10-27T18:15:41+00:00</updated>
<author>
<name>Nick Piggin</name>
<email>npiggin@suse.de</email>
</author>
<published>2008-10-23T14:25:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=cae042a73bb22fc4132b04ff94bd684456203089'/>
<id>cae042a73bb22fc4132b04ff94bd684456203089</id>
<content type='text'>
Regular bitops don't work as locks on all architectures.

Also: can use non-atomic unlock as no concurrent stores to the word.

Signed-off-by: Nick Piggin &lt;npiggin@suse.de&gt;
Signed-off-by: Robert Richter &lt;robert.richter@amd.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Regular bitops don't work as locks on all architectures.

Also: can use non-atomic unlock as no concurrent stores to the word.

Signed-off-by: Nick Piggin &lt;npiggin@suse.de&gt;
Signed-off-by: Robert Richter &lt;robert.richter@amd.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>oprofile: fixing whitespaces in drivers/oprofile/*</title>
<updated>2008-10-16T13:01:40+00:00</updated>
<author>
<name>Robert Richter</name>
<email>robert.richter@amd.com</email>
</author>
<published>2008-10-16T13:01:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6a18037d4165f691063b43816be3152e9006eb06'/>
<id>6a18037d4165f691063b43816be3152e9006eb06</id>
<content type='text'>
Signed-off-by: Robert Richter &lt;robert.richter@amd.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Robert Richter &lt;robert.richter@amd.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>oprofile: more whitespace fixes</title>
<updated>2008-10-15T18:55:51+00:00</updated>
<author>
<name>Robert Richter</name>
<email>robert.richter@amd.com</email>
</author>
<published>2008-09-05T15:12:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=25ad2913cae9c9e3ed28075caeb2eefccd636f4f'/>
<id>25ad2913cae9c9e3ed28075caeb2eefccd636f4f</id>
<content type='text'>
Signed-off-by: Robert Richter &lt;robert.richter@amd.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Robert Richter &lt;robert.richter@amd.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>powerpc/cell/oprofile: Avoid double vfree of profile buffer</title>
<updated>2008-08-26T00:24:46+00:00</updated>
<author>
<name>Carl Love</name>
<email>cel@us.ibm.com</email>
</author>
<published>2008-08-11T07:25:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f4156d1cd1dc260cca767a6c0636625f05446799'/>
<id>f4156d1cd1dc260cca767a6c0636625f05446799</id>
<content type='text'>
If an error occurs on opcontrol start, the event and per cpu buffers
are released.  If later opcontrol shutdown is called then the free
function will be called again to free buffers that no longer
exist.  This results in a kernel oops.  The following changes
prevent the call to delete buffers that don't exist.

Signed-off-by: Carl Love &lt;carll@us.ibm.com&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Acked-by: Robert Richter &lt;robert.richter@amd.com&gt;
Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If an error occurs on opcontrol start, the event and per cpu buffers
are released.  If later opcontrol shutdown is called then the free
function will be called again to free buffers that no longer
exist.  This results in a kernel oops.  The following changes
prevent the call to delete buffers that don't exist.

Signed-off-by: Carl Love &lt;carll@us.ibm.com&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Acked-by: Robert Richter &lt;robert.richter@amd.com&gt;
Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] oprofile: fix potential deadlock on oprofilefs_lock</title>
<updated>2007-03-28T20:58:02+00:00</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2007-03-28T16:12:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4dfc896e90359df04c80da5ab08ec31e87846c43'/>
<id>4dfc896e90359df04c80da5ab08ec31e87846c43</id>
<content type='text'>
nmi_cpu_setup() is called from hardirq context and acquires oprofilefs_lock.
alloc_event_buffer() and oprofilefs_ulong_from_user() acquire this lock
without disabling irqs, which could deadlock.

Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
nmi_cpu_setup() is called from hardirq context and acquires oprofilefs_lock.
alloc_event_buffer() and oprofilefs_ulong_from_user() acquire this lock
without disabling irqs, which could deadlock.

Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
