<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/oprofile, branch v3.0.16</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>oprofile: Fix uninitialized memory access when writing to writing to oprofilefs</title>
<updated>2012-01-06T22:13:51+00:00</updated>
<author>
<name>Robert Richter</name>
<email>robert.richter@amd.com</email>
</author>
<published>2011-12-19T15:38:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3c681ec96dcc0acd6d5386773b44e6c129919394'/>
<id>3c681ec96dcc0acd6d5386773b44e6c129919394</id>
<content type='text'>
commit 913050b91eb94f194392dd797b1ff3779f606ac0 upstream.

If oprofilefs_ulong_from_user() is called with count equals
zero, *val remains unchanged. Depending on the implementation it
might be uninitialized.

Change oprofilefs_ulong_from_user()'s interface to return count
on success. Thus, we are able to return early if count equals
zero which avoids using *val uninitialized. Fixing all users of
oprofilefs_ulong_ from_user().

This follows write syscall implementation when count is zero:
"If count is zero ... [and if] no errors are detected, 0 will be
returned without causing any other effect." (man 2 write)

Reported-By: Mike Waychison &lt;mikew@google.com&gt;
Signed-off-by: Robert Richter &lt;robert.richter@amd.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: oprofile-list &lt;oprofile-list@lists.sourceforge.net&gt;
Link: http://lkml.kernel.org/r/20111219153830.GH16765@erda.amd.com
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 913050b91eb94f194392dd797b1ff3779f606ac0 upstream.

If oprofilefs_ulong_from_user() is called with count equals
zero, *val remains unchanged. Depending on the implementation it
might be uninitialized.

Change oprofilefs_ulong_from_user()'s interface to return count
on success. Thus, we are able to return early if count equals
zero which avoids using *val uninitialized. Fixing all users of
oprofilefs_ulong_ from_user().

This follows write syscall implementation when count is zero:
"If count is zero ... [and if] no errors are detected, 0 will be
returned without causing any other effect." (man 2 write)

Reported-By: Mike Waychison &lt;mikew@google.com&gt;
Signed-off-by: Robert Richter &lt;robert.richter@amd.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: oprofile-list &lt;oprofile-list@lists.sourceforge.net&gt;
Link: http://lkml.kernel.org/r/20111219153830.GH16765@erda.amd.com
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>oprofile: Fix crash when unloading module (hr timer mode)</title>
<updated>2011-12-09T16:52:50+00:00</updated>
<author>
<name>Robert Richter</name>
<email>robert.richter@amd.com</email>
</author>
<published>2011-10-07T14:31:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0bbf5c70251286fbc3b7aac5e7961b4568115bfd'/>
<id>0bbf5c70251286fbc3b7aac5e7961b4568115bfd</id>
<content type='text'>
commit 87121ca504fd1d963a66b3fb0c72054b0fd9a177 upstream.

Oprofile may crash in a KVM guest while unlaoding modules. This
happens if oprofile_arch_init() fails and oprofile switches to the hr
timer mode as a fallback. In this case oprofile_arch_exit() is called,
but it never was initialized properly which causes the crash. This
patch fixes this.

oprofile: using timer interrupt.
BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
IP: [&lt;ffffffff8123c226&gt;] unregister_syscore_ops+0x41/0x58
PGD 41da3f067 PUD 41d80e067 PMD 0
Oops: 0002 [#1] PREEMPT SMP
CPU 5
Modules linked in: oprofile(-)

Pid: 2382, comm: modprobe Not tainted 3.1.0-rc7-00018-g709a39d #18 Advanced Micro Device Anaheim/Anaheim
RIP: 0010:[&lt;ffffffff8123c226&gt;]  [&lt;ffffffff8123c226&gt;] unregister_syscore_ops+0x41/0x58
RSP: 0018:ffff88041de1de98  EFLAGS: 00010296
RAX: 0000000000000000 RBX: ffffffffa00060e0 RCX: dead000000200200
RDX: 0000000000000000 RSI: dead000000100100 RDI: ffffffff8178c620
RBP: ffff88041de1dea8 R08: 0000000000000001 R09: 0000000000000082
R10: 0000000000000000 R11: ffff88041de1dde8 R12: 0000000000000080
R13: fffffffffffffff5 R14: 0000000000000001 R15: 0000000000610210
FS:  00007f9ae5bef700(0000) GS:ffff88042fd40000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000000008 CR3: 000000041ca44000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process modprobe (pid: 2382, threadinfo ffff88041de1c000, task ffff88042db6d040)
Stack:
 ffff88041de1deb8 ffffffffa0006770 ffff88041de1deb8 ffffffffa000251e
 ffff88041de1dec8 ffffffffa00022c2 ffff88041de1ded8 ffffffffa0004993
 ffff88041de1df78 ffffffff81073115 656c69666f72706f 0000000000610200
Call Trace:
 [&lt;ffffffffa000251e&gt;] op_nmi_exit+0x15/0x17 [oprofile]
 [&lt;ffffffffa00022c2&gt;] oprofile_arch_exit+0xe/0x10 [oprofile]
 [&lt;ffffffffa0004993&gt;] oprofile_exit+0x13/0x15 [oprofile]
 [&lt;ffffffff81073115&gt;] sys_delete_module+0x1c3/0x22f
 [&lt;ffffffff811bf09e&gt;] ? trace_hardirqs_on_thunk+0x3a/0x3f
 [&lt;ffffffff8148070b&gt;] system_call_fastpath+0x16/0x1b
Code: 20 c6 78 81 e8 c5 cc 23 00 48 8b 13 48 8b 43 08 48 be 00 01 10 00 00 00 ad de 48 b9 00 02 20 00 00 00 ad de 48 c7 c7 20 c6 78 81
 89 42 08 48 89 10 48 89 33 48 89 4b 08 e8 a6 c0 23 00 5a 5b
RIP  [&lt;ffffffff8123c226&gt;] unregister_syscore_ops+0x41/0x58
 RSP &lt;ffff88041de1de98&gt;
CR2: 0000000000000008
---[ end trace 06d4e95b6aa3b437 ]---

Signed-off-by: Robert Richter &lt;robert.richter@amd.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 87121ca504fd1d963a66b3fb0c72054b0fd9a177 upstream.

Oprofile may crash in a KVM guest while unlaoding modules. This
happens if oprofile_arch_init() fails and oprofile switches to the hr
timer mode as a fallback. In this case oprofile_arch_exit() is called,
but it never was initialized properly which causes the crash. This
patch fixes this.

oprofile: using timer interrupt.
BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
IP: [&lt;ffffffff8123c226&gt;] unregister_syscore_ops+0x41/0x58
PGD 41da3f067 PUD 41d80e067 PMD 0
Oops: 0002 [#1] PREEMPT SMP
CPU 5
Modules linked in: oprofile(-)

Pid: 2382, comm: modprobe Not tainted 3.1.0-rc7-00018-g709a39d #18 Advanced Micro Device Anaheim/Anaheim
RIP: 0010:[&lt;ffffffff8123c226&gt;]  [&lt;ffffffff8123c226&gt;] unregister_syscore_ops+0x41/0x58
RSP: 0018:ffff88041de1de98  EFLAGS: 00010296
RAX: 0000000000000000 RBX: ffffffffa00060e0 RCX: dead000000200200
RDX: 0000000000000000 RSI: dead000000100100 RDI: ffffffff8178c620
RBP: ffff88041de1dea8 R08: 0000000000000001 R09: 0000000000000082
R10: 0000000000000000 R11: ffff88041de1dde8 R12: 0000000000000080
R13: fffffffffffffff5 R14: 0000000000000001 R15: 0000000000610210
FS:  00007f9ae5bef700(0000) GS:ffff88042fd40000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000000008 CR3: 000000041ca44000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process modprobe (pid: 2382, threadinfo ffff88041de1c000, task ffff88042db6d040)
Stack:
 ffff88041de1deb8 ffffffffa0006770 ffff88041de1deb8 ffffffffa000251e
 ffff88041de1dec8 ffffffffa00022c2 ffff88041de1ded8 ffffffffa0004993
 ffff88041de1df78 ffffffff81073115 656c69666f72706f 0000000000610200
Call Trace:
 [&lt;ffffffffa000251e&gt;] op_nmi_exit+0x15/0x17 [oprofile]
 [&lt;ffffffffa00022c2&gt;] oprofile_arch_exit+0xe/0x10 [oprofile]
 [&lt;ffffffffa0004993&gt;] oprofile_exit+0x13/0x15 [oprofile]
 [&lt;ffffffff81073115&gt;] sys_delete_module+0x1c3/0x22f
 [&lt;ffffffff811bf09e&gt;] ? trace_hardirqs_on_thunk+0x3a/0x3f
 [&lt;ffffffff8148070b&gt;] system_call_fastpath+0x16/0x1b
Code: 20 c6 78 81 e8 c5 cc 23 00 48 8b 13 48 8b 43 08 48 be 00 01 10 00 00 00 ad de 48 b9 00 02 20 00 00 00 ad de 48 c7 c7 20 c6 78 81
 89 42 08 48 89 10 48 89 33 48 89 4b 08 e8 a6 c0 23 00 5a 5b
RIP  [&lt;ffffffff8123c226&gt;] unregister_syscore_ops+0x41/0x58
 RSP &lt;ffff88041de1de98&gt;
CR2: 0000000000000008
---[ end trace 06d4e95b6aa3b437 ]---

Signed-off-by: Robert Richter &lt;robert.richter@amd.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>oprofile: Fix locking dependency in sync_start()</title>
<updated>2011-05-31T14:33:34+00:00</updated>
<author>
<name>Robert Richter</name>
<email>robert.richter@amd.com</email>
</author>
<published>2011-05-26T16:39:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=130c5ce716c9bfd1c2a2ec840a746eb7ff9ce1e6'/>
<id>130c5ce716c9bfd1c2a2ec840a746eb7ff9ce1e6</id>
<content type='text'>
This fixes the A-&gt;B/B-&gt;A locking dependency, see the warning below.

The function task_exit_notify() is called with (task_exit_notifier)
.rwsem set and then calls sync_buffer() which locks buffer_mutex. In
sync_start() the buffer_mutex was set to prevent notifier functions to
be started before sync_start() is finished. But when registering the
notifier, (task_exit_notifier).rwsem is locked too, but now in
different order than in sync_buffer(). In theory this causes a locking
dependency, what does not occur in practice since task_exit_notify()
is always called after the notifier is registered which means the lock
is already released.

However, after checking the notifier functions it turned out the
buffer_mutex in sync_start() is unnecessary. This is because
sync_buffer() may be called from the notifiers even if sync_start()
did not finish yet, the buffers are already allocated but empty. No
need to protect this with the mutex.

So we fix this theoretical locking dependency by removing buffer_mutex
in sync_start(). This is similar to the implementation before commit:

 750d857 oprofile: fix crash when accessing freed task structs

which introduced the locking dependency.

Lockdep warning:

oprofiled/4447 is trying to acquire lock:
 (buffer_mutex){+.+...}, at: [&lt;ffffffffa0000e55&gt;] sync_buffer+0x31/0x3ec [oprofile]

but task is already holding lock:
 ((task_exit_notifier).rwsem){++++..}, at: [&lt;ffffffff81058026&gt;] __blocking_notifier_call_chain+0x39/0x67

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-&gt; #1 ((task_exit_notifier).rwsem){++++..}:
       [&lt;ffffffff8106557f&gt;] lock_acquire+0xf8/0x11e
       [&lt;ffffffff81463a2b&gt;] down_write+0x44/0x67
       [&lt;ffffffff810581c0&gt;] blocking_notifier_chain_register+0x52/0x8b
       [&lt;ffffffff8105a6ac&gt;] profile_event_register+0x2d/0x2f
       [&lt;ffffffffa00013c1&gt;] sync_start+0x47/0xc6 [oprofile]
       [&lt;ffffffffa00001bb&gt;] oprofile_setup+0x60/0xa5 [oprofile]
       [&lt;ffffffffa00014e3&gt;] event_buffer_open+0x59/0x8c [oprofile]
       [&lt;ffffffff810cd3b9&gt;] __dentry_open+0x1eb/0x308
       [&lt;ffffffff810cd59d&gt;] nameidata_to_filp+0x60/0x67
       [&lt;ffffffff810daad6&gt;] do_last+0x5be/0x6b2
       [&lt;ffffffff810dbc33&gt;] path_openat+0xc7/0x360
       [&lt;ffffffff810dbfc5&gt;] do_filp_open+0x3d/0x8c
       [&lt;ffffffff810ccfd2&gt;] do_sys_open+0x110/0x1a9
       [&lt;ffffffff810cd09e&gt;] sys_open+0x20/0x22
       [&lt;ffffffff8146ad4b&gt;] system_call_fastpath+0x16/0x1b

-&gt; #0 (buffer_mutex){+.+...}:
       [&lt;ffffffff81064dfb&gt;] __lock_acquire+0x1085/0x1711
       [&lt;ffffffff8106557f&gt;] lock_acquire+0xf8/0x11e
       [&lt;ffffffff814634f0&gt;] mutex_lock_nested+0x63/0x309
       [&lt;ffffffffa0000e55&gt;] sync_buffer+0x31/0x3ec [oprofile]
       [&lt;ffffffffa0001226&gt;] task_exit_notify+0x16/0x1a [oprofile]
       [&lt;ffffffff81467b96&gt;] notifier_call_chain+0x37/0x63
       [&lt;ffffffff8105803d&gt;] __blocking_notifier_call_chain+0x50/0x67
       [&lt;ffffffff81058068&gt;] blocking_notifier_call_chain+0x14/0x16
       [&lt;ffffffff8105a718&gt;] profile_task_exit+0x1a/0x1c
       [&lt;ffffffff81039e8f&gt;] do_exit+0x2a/0x6fc
       [&lt;ffffffff8103a5e4&gt;] do_group_exit+0x83/0xae
       [&lt;ffffffff8103a626&gt;] sys_exit_group+0x17/0x1b
       [&lt;ffffffff8146ad4b&gt;] system_call_fastpath+0x16/0x1b

other info that might help us debug this:

1 lock held by oprofiled/4447:
 #0:  ((task_exit_notifier).rwsem){++++..}, at: [&lt;ffffffff81058026&gt;] __blocking_notifier_call_chain+0x39/0x67

stack backtrace:
Pid: 4447, comm: oprofiled Not tainted 2.6.39-00007-gcf4d8d4 #10
Call Trace:
 [&lt;ffffffff81063193&gt;] print_circular_bug+0xae/0xbc
 [&lt;ffffffff81064dfb&gt;] __lock_acquire+0x1085/0x1711
 [&lt;ffffffffa0000e55&gt;] ? sync_buffer+0x31/0x3ec [oprofile]
 [&lt;ffffffff8106557f&gt;] lock_acquire+0xf8/0x11e
 [&lt;ffffffffa0000e55&gt;] ? sync_buffer+0x31/0x3ec [oprofile]
 [&lt;ffffffff81062627&gt;] ? mark_lock+0x42f/0x552
 [&lt;ffffffffa0000e55&gt;] ? sync_buffer+0x31/0x3ec [oprofile]
 [&lt;ffffffff814634f0&gt;] mutex_lock_nested+0x63/0x309
 [&lt;ffffffffa0000e55&gt;] ? sync_buffer+0x31/0x3ec [oprofile]
 [&lt;ffffffffa0000e55&gt;] sync_buffer+0x31/0x3ec [oprofile]
 [&lt;ffffffff81058026&gt;] ? __blocking_notifier_call_chain+0x39/0x67
 [&lt;ffffffff81058026&gt;] ? __blocking_notifier_call_chain+0x39/0x67
 [&lt;ffffffffa0001226&gt;] task_exit_notify+0x16/0x1a [oprofile]
 [&lt;ffffffff81467b96&gt;] notifier_call_chain+0x37/0x63
 [&lt;ffffffff8105803d&gt;] __blocking_notifier_call_chain+0x50/0x67
 [&lt;ffffffff81058068&gt;] blocking_notifier_call_chain+0x14/0x16
 [&lt;ffffffff8105a718&gt;] profile_task_exit+0x1a/0x1c
 [&lt;ffffffff81039e8f&gt;] do_exit+0x2a/0x6fc
 [&lt;ffffffff81465031&gt;] ? retint_swapgs+0xe/0x13
 [&lt;ffffffff8103a5e4&gt;] do_group_exit+0x83/0xae
 [&lt;ffffffff8103a626&gt;] sys_exit_group+0x17/0x1b
 [&lt;ffffffff8146ad4b&gt;] system_call_fastpath+0x16/0x1b

Reported-by: Marcin Slusarz &lt;marcin.slusarz@gmail.com&gt;
Cc: Carl Love &lt;carll@us.ibm.com&gt;
Cc: &lt;stable@kernel.org&gt; # .36+
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 fixes the A-&gt;B/B-&gt;A locking dependency, see the warning below.

The function task_exit_notify() is called with (task_exit_notifier)
.rwsem set and then calls sync_buffer() which locks buffer_mutex. In
sync_start() the buffer_mutex was set to prevent notifier functions to
be started before sync_start() is finished. But when registering the
notifier, (task_exit_notifier).rwsem is locked too, but now in
different order than in sync_buffer(). In theory this causes a locking
dependency, what does not occur in practice since task_exit_notify()
is always called after the notifier is registered which means the lock
is already released.

However, after checking the notifier functions it turned out the
buffer_mutex in sync_start() is unnecessary. This is because
sync_buffer() may be called from the notifiers even if sync_start()
did not finish yet, the buffers are already allocated but empty. No
need to protect this with the mutex.

So we fix this theoretical locking dependency by removing buffer_mutex
in sync_start(). This is similar to the implementation before commit:

 750d857 oprofile: fix crash when accessing freed task structs

which introduced the locking dependency.

Lockdep warning:

oprofiled/4447 is trying to acquire lock:
 (buffer_mutex){+.+...}, at: [&lt;ffffffffa0000e55&gt;] sync_buffer+0x31/0x3ec [oprofile]

but task is already holding lock:
 ((task_exit_notifier).rwsem){++++..}, at: [&lt;ffffffff81058026&gt;] __blocking_notifier_call_chain+0x39/0x67

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-&gt; #1 ((task_exit_notifier).rwsem){++++..}:
       [&lt;ffffffff8106557f&gt;] lock_acquire+0xf8/0x11e
       [&lt;ffffffff81463a2b&gt;] down_write+0x44/0x67
       [&lt;ffffffff810581c0&gt;] blocking_notifier_chain_register+0x52/0x8b
       [&lt;ffffffff8105a6ac&gt;] profile_event_register+0x2d/0x2f
       [&lt;ffffffffa00013c1&gt;] sync_start+0x47/0xc6 [oprofile]
       [&lt;ffffffffa00001bb&gt;] oprofile_setup+0x60/0xa5 [oprofile]
       [&lt;ffffffffa00014e3&gt;] event_buffer_open+0x59/0x8c [oprofile]
       [&lt;ffffffff810cd3b9&gt;] __dentry_open+0x1eb/0x308
       [&lt;ffffffff810cd59d&gt;] nameidata_to_filp+0x60/0x67
       [&lt;ffffffff810daad6&gt;] do_last+0x5be/0x6b2
       [&lt;ffffffff810dbc33&gt;] path_openat+0xc7/0x360
       [&lt;ffffffff810dbfc5&gt;] do_filp_open+0x3d/0x8c
       [&lt;ffffffff810ccfd2&gt;] do_sys_open+0x110/0x1a9
       [&lt;ffffffff810cd09e&gt;] sys_open+0x20/0x22
       [&lt;ffffffff8146ad4b&gt;] system_call_fastpath+0x16/0x1b

-&gt; #0 (buffer_mutex){+.+...}:
       [&lt;ffffffff81064dfb&gt;] __lock_acquire+0x1085/0x1711
       [&lt;ffffffff8106557f&gt;] lock_acquire+0xf8/0x11e
       [&lt;ffffffff814634f0&gt;] mutex_lock_nested+0x63/0x309
       [&lt;ffffffffa0000e55&gt;] sync_buffer+0x31/0x3ec [oprofile]
       [&lt;ffffffffa0001226&gt;] task_exit_notify+0x16/0x1a [oprofile]
       [&lt;ffffffff81467b96&gt;] notifier_call_chain+0x37/0x63
       [&lt;ffffffff8105803d&gt;] __blocking_notifier_call_chain+0x50/0x67
       [&lt;ffffffff81058068&gt;] blocking_notifier_call_chain+0x14/0x16
       [&lt;ffffffff8105a718&gt;] profile_task_exit+0x1a/0x1c
       [&lt;ffffffff81039e8f&gt;] do_exit+0x2a/0x6fc
       [&lt;ffffffff8103a5e4&gt;] do_group_exit+0x83/0xae
       [&lt;ffffffff8103a626&gt;] sys_exit_group+0x17/0x1b
       [&lt;ffffffff8146ad4b&gt;] system_call_fastpath+0x16/0x1b

other info that might help us debug this:

1 lock held by oprofiled/4447:
 #0:  ((task_exit_notifier).rwsem){++++..}, at: [&lt;ffffffff81058026&gt;] __blocking_notifier_call_chain+0x39/0x67

stack backtrace:
Pid: 4447, comm: oprofiled Not tainted 2.6.39-00007-gcf4d8d4 #10
Call Trace:
 [&lt;ffffffff81063193&gt;] print_circular_bug+0xae/0xbc
 [&lt;ffffffff81064dfb&gt;] __lock_acquire+0x1085/0x1711
 [&lt;ffffffffa0000e55&gt;] ? sync_buffer+0x31/0x3ec [oprofile]
 [&lt;ffffffff8106557f&gt;] lock_acquire+0xf8/0x11e
 [&lt;ffffffffa0000e55&gt;] ? sync_buffer+0x31/0x3ec [oprofile]
 [&lt;ffffffff81062627&gt;] ? mark_lock+0x42f/0x552
 [&lt;ffffffffa0000e55&gt;] ? sync_buffer+0x31/0x3ec [oprofile]
 [&lt;ffffffff814634f0&gt;] mutex_lock_nested+0x63/0x309
 [&lt;ffffffffa0000e55&gt;] ? sync_buffer+0x31/0x3ec [oprofile]
 [&lt;ffffffffa0000e55&gt;] sync_buffer+0x31/0x3ec [oprofile]
 [&lt;ffffffff81058026&gt;] ? __blocking_notifier_call_chain+0x39/0x67
 [&lt;ffffffff81058026&gt;] ? __blocking_notifier_call_chain+0x39/0x67
 [&lt;ffffffffa0001226&gt;] task_exit_notify+0x16/0x1a [oprofile]
 [&lt;ffffffff81467b96&gt;] notifier_call_chain+0x37/0x63
 [&lt;ffffffff8105803d&gt;] __blocking_notifier_call_chain+0x50/0x67
 [&lt;ffffffff81058068&gt;] blocking_notifier_call_chain+0x14/0x16
 [&lt;ffffffff8105a718&gt;] profile_task_exit+0x1a/0x1c
 [&lt;ffffffff81039e8f&gt;] do_exit+0x2a/0x6fc
 [&lt;ffffffff81465031&gt;] ? retint_swapgs+0xe/0x13
 [&lt;ffffffff8103a5e4&gt;] do_group_exit+0x83/0xae
 [&lt;ffffffff8103a626&gt;] sys_exit_group+0x17/0x1b
 [&lt;ffffffff8146ad4b&gt;] system_call_fastpath+0x16/0x1b

Reported-by: Marcin Slusarz &lt;marcin.slusarz@gmail.com&gt;
Cc: Carl Love &lt;carll@us.ibm.com&gt;
Cc: &lt;stable@kernel.org&gt; # .36+
Signed-off-by: Robert Richter &lt;robert.richter@amd.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>oprofile: Free potentially owned tasks in case of errors</title>
<updated>2011-05-31T14:33:33+00:00</updated>
<author>
<name>Robert Richter</name>
<email>robert.richter@amd.com</email>
</author>
<published>2011-05-26T16:22:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6ac6519b93065625119a347be1cbcc1b89edb773'/>
<id>6ac6519b93065625119a347be1cbcc1b89edb773</id>
<content type='text'>
After registering the task free notifier we possibly have tasks in our
dying_tasks list. Free them after unregistering the notifier in case
of an error.

Cc: &lt;stable@kernel.org&gt; # .36+
Signed-off-by: Robert Richter &lt;robert.richter@amd.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After registering the task free notifier we possibly have tasks in our
dying_tasks list. Free them after unregistering the notifier in case
of an error.

Cc: &lt;stable@kernel.org&gt; # .36+
Signed-off-by: Robert Richter &lt;robert.richter@amd.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>oprofile: Use linux/mutex.h</title>
<updated>2011-05-24T10:45:59+00:00</updated>
<author>
<name>Anton Blanchard</name>
<email>anton@samba.org</email>
</author>
<published>2011-05-08T23:32:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b76a06e08d94b2a63e47837dfe46bbbf0a3af6c2'/>
<id>b76a06e08d94b2a63e47837dfe46bbbf0a3af6c2</id>
<content type='text'>
The oprofile code is still including asm/mutex.h instead of
linux/mutex.h.

Signed-off-by: Anton Blanchard &lt;anton@samba.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>
The oprofile code is still including asm/mutex.h instead of
linux/mutex.h.

Signed-off-by: Anton Blanchard &lt;anton@samba.org&gt;
Signed-off-by: Robert Richter &lt;robert.richter@amd.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>oprofile, s390: Rework hwsampler implementation</title>
<updated>2011-02-15T10:10:20+00:00</updated>
<author>
<name>Robert Richter</name>
<email>robert.richter@amd.com</email>
</author>
<published>2011-02-11T16:31:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a0d76247e07abd14968adc4486aaa8e270e9c209'/>
<id>a0d76247e07abd14968adc4486aaa8e270e9c209</id>
<content type='text'>
This patch is a rework of the hwsampler oprofile implementation that
has been applied recently. Now there are less non-architectural
changes. The only changes are:

* introduction of oprofile_add_ext_hw_sample(), and
* removal of section attributes of oprofile_timer_init/_exit().

To setup hwsampler for oprofile we need to modify start()/stop()
callbacks and additional hwsampler control files in oprofilefs. We do
not reinitialize the timer or hwsampler mode by restarting calling
init/exit() anymore, instead hwsampler_running is used to switch the
mode directly in oprofile_hwsampler_start/_stop(). For locking reasons
there is also hwsampler_file that reflects the value in oprofilefs.

The overall diffstat of the oprofile s390 hwsampler implemenation
shows the low impact to non-architectural code:

 arch/Kconfig                         |    3 +
 arch/s390/Kconfig                    |    1 +
 arch/s390/oprofile/Makefile          |    2 +-
 arch/s390/oprofile/hwsampler.c       | 1256 ++++++++++++++++++++++++++++++++++
 arch/s390/oprofile/hwsampler.h       |  113 +++
 arch/s390/oprofile/hwsampler_files.c |  162 +++++
 arch/s390/oprofile/init.c            |    6 +-
 drivers/oprofile/cpu_buffer.c        |   24 +-
 drivers/oprofile/timer_int.c         |    4 +-
 include/linux/oprofile.h             |    7 +
 10 files changed, 1567 insertions(+), 11 deletions(-)

Acked-by: Heiko Carstens &lt;heiko.carstens@de.ibm.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>
This patch is a rework of the hwsampler oprofile implementation that
has been applied recently. Now there are less non-architectural
changes. The only changes are:

* introduction of oprofile_add_ext_hw_sample(), and
* removal of section attributes of oprofile_timer_init/_exit().

To setup hwsampler for oprofile we need to modify start()/stop()
callbacks and additional hwsampler control files in oprofilefs. We do
not reinitialize the timer or hwsampler mode by restarting calling
init/exit() anymore, instead hwsampler_running is used to switch the
mode directly in oprofile_hwsampler_start/_stop(). For locking reasons
there is also hwsampler_file that reflects the value in oprofilefs.

The overall diffstat of the oprofile s390 hwsampler implemenation
shows the low impact to non-architectural code:

 arch/Kconfig                         |    3 +
 arch/s390/Kconfig                    |    1 +
 arch/s390/oprofile/Makefile          |    2 +-
 arch/s390/oprofile/hwsampler.c       | 1256 ++++++++++++++++++++++++++++++++++
 arch/s390/oprofile/hwsampler.h       |  113 +++
 arch/s390/oprofile/hwsampler_files.c |  162 +++++
 arch/s390/oprofile/init.c            |    6 +-
 drivers/oprofile/cpu_buffer.c        |   24 +-
 drivers/oprofile/timer_int.c         |    4 +-
 include/linux/oprofile.h             |    7 +
 10 files changed, 1567 insertions(+), 11 deletions(-)

Acked-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Robert Richter &lt;robert.richter@amd.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>oprofile, s390: Enhance OProfile to support System zs hardware sampling feature</title>
<updated>2011-02-15T10:08:50+00:00</updated>
<author>
<name>Heinz Graalfs</name>
<email>graalfs@linux.vnet.ibm.com</email>
</author>
<published>2011-01-21T10:06:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=997dbb4967da248808850c250182ef2528fff2d1'/>
<id>997dbb4967da248808850c250182ef2528fff2d1</id>
<content type='text'>
OProfile is enhanced to export all files for controlling System z's
hardware sampling, and to invoke hwsampler exported functions to
initialize and use System z's hardware sampling.

The patch invokes hwsampler_setup() during oprofile init and exports
following hwsampler files under oprofilefs if hwsampler's setup
succeeded:

A new directory for hardware sampling based files

 /dev/oprofile/hwsampling/

The userland daemon must explicitly write to the following files
to disable (or enable) hardware based sampling

 /dev/oprofile/hwsampling/hwsampler

to modify the actual sampling rate

 /dev/oprofile/hwsampling/hw_interval

to modify the amount of sampling memory (measured in 4K pages)

 /dev/oprofile/hwsampling/hw_sdbt_blocks

The following files are read only and show
the possible minimum sampling rate

 /dev/oprofile/hwsampling/hw_min_interval

the possible maximum sampling rate

 /dev/oprofile/hwsampling/hw_max_interval

The patch splits the oprofile_timer_[init/exit] function so that it
can be also called through user context (oprofilefs) to avoid kernel
oops.

Applied with following changes:
* whitespace changes in Makefile and timer_int.c

Signed-off-by: Mahesh Salgaonkar &lt;mahesh@linux.vnet.ibm.com&gt;
Signed-off-by: Maran Pakkirisamy &lt;maranp@linux.vnet.ibm.com&gt;
Signed-off-by: Heinz Graalfs &lt;graalfs@linux.vnet.ibm.com&gt;
Acked-by: Heiko Carstens &lt;heiko.carstens@de.ibm.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>
OProfile is enhanced to export all files for controlling System z's
hardware sampling, and to invoke hwsampler exported functions to
initialize and use System z's hardware sampling.

The patch invokes hwsampler_setup() during oprofile init and exports
following hwsampler files under oprofilefs if hwsampler's setup
succeeded:

A new directory for hardware sampling based files

 /dev/oprofile/hwsampling/

The userland daemon must explicitly write to the following files
to disable (or enable) hardware based sampling

 /dev/oprofile/hwsampling/hwsampler

to modify the actual sampling rate

 /dev/oprofile/hwsampling/hw_interval

to modify the amount of sampling memory (measured in 4K pages)

 /dev/oprofile/hwsampling/hw_sdbt_blocks

The following files are read only and show
the possible minimum sampling rate

 /dev/oprofile/hwsampling/hw_min_interval

the possible maximum sampling rate

 /dev/oprofile/hwsampling/hw_max_interval

The patch splits the oprofile_timer_[init/exit] function so that it
can be also called through user context (oprofilefs) to avoid kernel
oops.

Applied with following changes:
* whitespace changes in Makefile and timer_int.c

Signed-off-by: Mahesh Salgaonkar &lt;mahesh@linux.vnet.ibm.com&gt;
Signed-off-by: Maran Pakkirisamy &lt;maranp@linux.vnet.ibm.com&gt;
Signed-off-by: Heinz Graalfs &lt;graalfs@linux.vnet.ibm.com&gt;
Acked-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Robert Richter &lt;robert.richter@amd.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>oprofile: Introduce new oprofile sample add function (oprofile_add_ext_hw_sample)</title>
<updated>2011-02-15T10:07:07+00:00</updated>
<author>
<name>Heinz Graalfs</name>
<email>graalfs@linux.vnet.ibm.com</email>
</author>
<published>2011-01-21T10:06:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=54ebbe7ba51d97a28a9a406203d171d61858e4b9'/>
<id>54ebbe7ba51d97a28a9a406203d171d61858e4b9</id>
<content type='text'>
This patch introduces a new oprofile sample add function
(oprofile_add_ext_hw_sample) that can also take task_struct as an
argument, which is used by the hwsampler kernel module when copying
hardware samples to OProfile buffers.

Applied with following changes:
* removed #include &lt;linux/module.h&gt;
* whitespace changes
* removed conditional compilation (CONFIG_HAVE_HWSAMPLER)
* modified order of functions
* fix missing function definition in header file

Signed-off-by: Mahesh Salgaonkar &lt;mahesh@linux.vnet.ibm.com&gt;
Signed-off-by: Maran Pakkirisamy &lt;maranp@linux.vnet.ibm.com&gt;
Signed-off-by: Heinz Graalfs &lt;graalfs@linux.vnet.ibm.com&gt;
Acked-by: Heiko Carstens &lt;heiko.carstens@de.ibm.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>
This patch introduces a new oprofile sample add function
(oprofile_add_ext_hw_sample) that can also take task_struct as an
argument, which is used by the hwsampler kernel module when copying
hardware samples to OProfile buffers.

Applied with following changes:
* removed #include &lt;linux/module.h&gt;
* whitespace changes
* removed conditional compilation (CONFIG_HAVE_HWSAMPLER)
* modified order of functions
* fix missing function definition in header file

Signed-off-by: Mahesh Salgaonkar &lt;mahesh@linux.vnet.ibm.com&gt;
Signed-off-by: Maran Pakkirisamy &lt;maranp@linux.vnet.ibm.com&gt;
Signed-off-by: Heinz Graalfs &lt;graalfs@linux.vnet.ibm.com&gt;
Acked-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Robert Richter &lt;robert.richter@amd.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branches 'perf-fixes-for-linus' and 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip</title>
<updated>2010-10-30T18:43:26+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2010-10-30T18:43:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f02a38d86a14b6e544e218d806ffb0442785f62b'/>
<id>f02a38d86a14b6e544e218d806ffb0442785f62b</id>
<content type='text'>
* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  jump label: Add work around to i386 gcc asm goto bug
  x86, ftrace: Use safe noops, drop trap test
  jump_label: Fix unaligned traps on sparc.
  jump label: Make arch_jump_label_text_poke_early() optional
  jump label: Fix error with preempt disable holding mutex
  oprofile: Remove deprecated use of flush_scheduled_work()
  oprofile: Fix the hang while taking the cpu offline
  jump label: Fix deadlock b/w jump_label_mutex vs. text_mutex
  jump label: Fix module __init section race

* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: Check irq_remapped instead of remapping_enabled in destroy_irq()
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  jump label: Add work around to i386 gcc asm goto bug
  x86, ftrace: Use safe noops, drop trap test
  jump_label: Fix unaligned traps on sparc.
  jump label: Make arch_jump_label_text_poke_early() optional
  jump label: Fix error with preempt disable holding mutex
  oprofile: Remove deprecated use of flush_scheduled_work()
  oprofile: Fix the hang while taking the cpu offline
  jump label: Fix deadlock b/w jump_label_mutex vs. text_mutex
  jump label: Fix module __init section race

* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: Check irq_remapped instead of remapping_enabled in destroy_irq()
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'tip/perf/jump-label-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into perf/urgent</title>
<updated>2010-10-30T08:43:08+00:00</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2010-10-30T08:43:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=169ed55bd30305b933f52bfab32a58671d44ab68'/>
<id>169ed55bd30305b933f52bfab32a58671d44ab68</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
