<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/events, branch v3.4.84</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/kernel/events?h=v3.4.84</id>
<link rel='self' href='https://git.amat.us/linux/atom/kernel/events?h=v3.4.84'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2014-03-11T23:10:02Z</updated>
<entry>
<title>perf: Fix hotplug splat</title>
<updated>2014-03-11T23:10:02Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2014-02-24T11:06:12Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f80747a43fc2613b9f5e1ded16f50ef28815652e'/>
<id>urn:sha1:f80747a43fc2613b9f5e1ded16f50ef28815652e</id>
<content type='text'>
commit e3703f8cdfcf39c25c4338c3ad8e68891cca3731 upstream.

Drew Richardson reported that he could make the kernel go *boom* when hotplugging
while having perf events active.

It turned out that when you have a group event, the code in
__perf_event_exit_context() fails to remove the group siblings from
the context.

We then proceed with destroying and freeing the event, and when you
re-plug the CPU and try and add another event to that CPU, things go
*boom* because you've still got dead entries there.

Reported-by: Drew Richardson &lt;drew.richardson@arm.com&gt;
Signed-off-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Will Deacon &lt;will.deacon@arm.com&gt;
Link: http://lkml.kernel.org/n/tip-k6v5wundvusvcseqj1si0oz0@git.kernel.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>perf: Fix perf_cgroup_switch for sw-events</title>
<updated>2013-10-01T16:10:52Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2012-10-02T13:41:23Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1d48ca6f38fa39298474708abebeffef4ef2cd2d'/>
<id>urn:sha1:1d48ca6f38fa39298474708abebeffef4ef2cd2d</id>
<content type='text'>
commit 95cf59ea72331d0093010543b8951bb43f262cac upstream.

Jiri reported that he could trigger the WARN_ON_ONCE() in
perf_cgroup_switch() using sw-events. This is because sw-events share
a cpuctx with multiple PMUs.

Use the -&gt;unique_pmu pointer to limit the pmu iteration to unique
cpuctx instances.

Reported-and-Tested-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Link: http://lkml.kernel.org/n/tip-so7wi2zf3jjzrwcutm2mkz0j@git.kernel.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Li Zefan &lt;lizefan@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>perf: Clarify perf_cpu_context::active_pmu usage by renaming it to ::unique_pmu</title>
<updated>2013-10-01T16:10:52Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2012-10-02T13:38:52Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2cd21fa1b54efaf6b5912ef2833fa474fdcf92b7'/>
<id>urn:sha1:2cd21fa1b54efaf6b5912ef2833fa474fdcf92b7</id>
<content type='text'>
commit 3f1f33206c16c7b3839d71372bc2ac3f305aa802 upstream.

Stephane thought the perf_cpu_context::active_pmu name confusing and
suggested using 'unique_pmu' instead.

This pointer is a pointer to a 'random' pmu sharing the cpuctx
instance, therefore limiting a for_each_pmu loop to those where
cpuctx-&gt;unique_pmu matches the pmu we get a loop over unique cpuctx
instances.

Suggested-by: Stephane Eranian &lt;eranian@google.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Link: http://lkml.kernel.org/n/tip-kxyjqpfj2fn9gt7kwu5ag9ks@git.kernel.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Li Zefan &lt;lizefan@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>perf: Use css_tryget() to avoid propping up css refcount</title>
<updated>2013-08-11T22:38:43Z</updated>
<author>
<name>Salman Qazi</name>
<email>sqazi@google.com</email>
</author>
<published>2012-06-14T22:31:09Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2d8be9cf0668fab848b9b7740f0725ae9181b703'/>
<id>urn:sha1:2d8be9cf0668fab848b9b7740f0725ae9181b703</id>
<content type='text'>
commit 9c5da09d266ca9b32eb16cf940f8161d949c2fe5 upstream.

An rmdir pushes css's ref count to zero.  However, if the associated
directory is open at the time, the dentry ref count is non-zero.  If
the fd for this directory is then passed into perf_event_open, it
does a css_get().  This bounces the ref count back up from zero.  This
is a problem by itself.  But what makes it turn into a crash is the
fact that we end up doing an extra dput, since we perform a dput
when css_put sees the ref count go down to zero.

css_tryget() does not fall into that trap. So, we use that instead.

Reproduction test-case for the bug:

 #include &lt;unistd.h&gt;
 #include &lt;sys/types.h&gt;
 #include &lt;sys/stat.h&gt;
 #include &lt;fcntl.h&gt;
 #include &lt;linux/unistd.h&gt;
 #include &lt;linux/perf_event.h&gt;
 #include &lt;string.h&gt;
 #include &lt;errno.h&gt;
 #include &lt;stdio.h&gt;

 #define PERF_FLAG_PID_CGROUP    (1U &lt;&lt; 2)

 int perf_event_open(struct perf_event_attr *hw_event_uptr,
                     pid_t pid, int cpu, int group_fd, unsigned long flags) {
         return syscall(__NR_perf_event_open,hw_event_uptr, pid, cpu,
                 group_fd, flags);
 }

 /*
  * Directly poke at the perf_event bug, since it's proving hard to repro
  * depending on where in the kernel tree.  what moved?
  */
 int main(int argc, char **argv)
 {
        int fd;
        struct perf_event_attr attr;
        memset(&amp;attr, 0, sizeof(attr));
        attr.exclude_kernel = 1;
        attr.size = sizeof(attr);
        mkdir("/dev/cgroup/perf_event/blah", 0777);
        fd = open("/dev/cgroup/perf_event/blah", O_RDONLY);
        perror("open");
        rmdir("/dev/cgroup/perf_event/blah");
        sleep(2);
        perf_event_open(&amp;attr, fd, 0, -1,  PERF_FLAG_PID_CGROUP);
        perror("perf_event_open");
        close(fd);
        return 0;
 }

Signed-off-by: Salman Qazi &lt;sqazi@google.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Link: http://lkml.kernel.org/r/20120614223108.1025.2503.stgit@dungbeetle.mtv.corp.google.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Li Zefan &lt;lizefan@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>perf: Fix event group context move</title>
<updated>2013-08-11T22:38:43Z</updated>
<author>
<name>Jiri Olsa</name>
<email>jolsa@redhat.com</email>
</author>
<published>2013-02-01T10:23:45Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5cbff87c00cf1b8e3a077465e4ec501dd21651c8'/>
<id>urn:sha1:5cbff87c00cf1b8e3a077465e4ec501dd21651c8</id>
<content type='text'>
commit 0231bb5336758426b44ccd798ccd3c5419c95d58 upstream.

When we have group with mixed events (hw/sw) we want to end up
with group leader being in hw context. So if group leader is
initialy sw event, we move all the events under hw context.

The move is done for each event by removing it from its context
and adding it back into proper one. As a part of the removal the
event is automatically disabled, which is not what we want at
this stage of creating groups.

The fix is to initialize event state after removal from sw
context.

This fix resulted from the following discussion:

  http://thread.gmane.org/gmane.linux.kernel.perf.user/1144

Reported-by: Andreas Hollmann &lt;hollmann@in.tum.de&gt;
Signed-off-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Corey Ashford &lt;cjashfor@linux.vnet.ibm.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Cc: Vince Weaver &lt;vince@deater.net&gt;
Link: http://lkml.kernel.org/r/1359714225-4231-1-git-send-email-jolsa@redhat.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Li Zefan &lt;lizefan@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>perf: Fix perf_lock_task_context() vs RCU</title>
<updated>2013-07-28T23:25:48Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2013-07-12T09:08:33Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=41154a356f6516ffa266e50ff7d1bf706893dfe3'/>
<id>urn:sha1:41154a356f6516ffa266e50ff7d1bf706893dfe3</id>
<content type='text'>
commit 058ebd0eba3aff16b144eabf4510ed9510e1416e upstream.

Jiri managed to trigger this warning:

 [] ======================================================
 [] [ INFO: possible circular locking dependency detected ]
 [] 3.10.0+ #228 Tainted: G        W
 [] -------------------------------------------------------
 [] p/6613 is trying to acquire lock:
 []  (rcu_node_0){..-...}, at: [&lt;ffffffff810ca797&gt;] rcu_read_unlock_special+0xa7/0x250
 []
 [] but task is already holding lock:
 []  (&amp;ctx-&gt;lock){-.-...}, at: [&lt;ffffffff810f2879&gt;] perf_lock_task_context+0xd9/0x2c0
 []
 [] which lock already depends on the new lock.
 []
 [] the existing dependency chain (in reverse order) is:
 []
 [] -&gt; #4 (&amp;ctx-&gt;lock){-.-...}:
 [] -&gt; #3 (&amp;rq-&gt;lock){-.-.-.}:
 [] -&gt; #2 (&amp;p-&gt;pi_lock){-.-.-.}:
 [] -&gt; #1 (&amp;rnp-&gt;nocb_gp_wq[1]){......}:
 [] -&gt; #0 (rcu_node_0){..-...}:

Paul was quick to explain that due to preemptible RCU we cannot call
rcu_read_unlock() while holding scheduler (or nested) locks when part
of the read side critical section was preemptible.

Therefore solve it by making the entire RCU read side non-preemptible.

Also pull out the retry from under the non-preempt to play nice with RT.

Reported-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Helped-out-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Signed-off-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>perf: Remove WARN_ON_ONCE() check in __perf_event_enable() for valid scenario</title>
<updated>2013-07-28T23:25:48Z</updated>
<author>
<name>Jiri Olsa</name>
<email>jolsa@redhat.com</email>
</author>
<published>2013-07-09T15:44:11Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1f11f44083bca90ce4f534023658d481b5707d94'/>
<id>urn:sha1:1f11f44083bca90ce4f534023658d481b5707d94</id>
<content type='text'>
commit 06f417968beac6e6b614e17b37d347aa6a6b1d30 upstream.

The '!ctx-&gt;is_active' check has a valid scenario, so
there's no need for the warning.

The reason is that there's a time window between the
'ctx-&gt;is_active' check in the perf_event_enable() function
and the __perf_event_enable() function having:

  - IRQs on
  - ctx-&gt;lock unlocked

where the task could be killed and 'ctx' deactivated by
perf_event_exit_task(), ending up with the warning below.

So remove the WARN_ON_ONCE() check and add comments to
explain it all.

This addresses the following warning reported by Vince Weaver:

[  324.983534] ------------[ cut here ]------------
[  324.984420] WARNING: at kernel/events/core.c:1953 __perf_event_enable+0x187/0x190()
[  324.984420] Modules linked in:
[  324.984420] CPU: 19 PID: 2715 Comm: nmi_bug_snb Not tainted 3.10.0+ #246
[  324.984420] Hardware name: Supermicro X8DTN/X8DTN, BIOS 4.6.3 01/08/2010
[  324.984420]  0000000000000009 ffff88043fce3ec8 ffffffff8160ea0b ffff88043fce3f00
[  324.984420]  ffffffff81080ff0 ffff8802314fdc00 ffff880231a8f800 ffff88043fcf7860
[  324.984420]  0000000000000286 ffff880231a8f800 ffff88043fce3f10 ffffffff8108103a
[  324.984420] Call Trace:
[  324.984420]  &lt;IRQ&gt;  [&lt;ffffffff8160ea0b&gt;] dump_stack+0x19/0x1b
[  324.984420]  [&lt;ffffffff81080ff0&gt;] warn_slowpath_common+0x70/0xa0
[  324.984420]  [&lt;ffffffff8108103a&gt;] warn_slowpath_null+0x1a/0x20
[  324.984420]  [&lt;ffffffff81134437&gt;] __perf_event_enable+0x187/0x190
[  324.984420]  [&lt;ffffffff81130030&gt;] remote_function+0x40/0x50
[  324.984420]  [&lt;ffffffff810e51de&gt;] generic_smp_call_function_single_interrupt+0xbe/0x130
[  324.984420]  [&lt;ffffffff81066a47&gt;] smp_call_function_single_interrupt+0x27/0x40
[  324.984420]  [&lt;ffffffff8161fd2f&gt;] call_function_single_interrupt+0x6f/0x80
[  324.984420]  &lt;EOI&gt;  [&lt;ffffffff816161a1&gt;] ? _raw_spin_unlock_irqrestore+0x41/0x70
[  324.984420]  [&lt;ffffffff8113799d&gt;] perf_event_exit_task+0x14d/0x210
[  324.984420]  [&lt;ffffffff810acd04&gt;] ? switch_task_namespaces+0x24/0x60
[  324.984420]  [&lt;ffffffff81086946&gt;] do_exit+0x2b6/0xa40
[  324.984420]  [&lt;ffffffff8161615c&gt;] ? _raw_spin_unlock_irq+0x2c/0x30
[  324.984420]  [&lt;ffffffff81087279&gt;] do_group_exit+0x49/0xc0
[  324.984420]  [&lt;ffffffff81096854&gt;] get_signal_to_deliver+0x254/0x620
[  324.984420]  [&lt;ffffffff81043057&gt;] do_signal+0x57/0x5a0
[  324.984420]  [&lt;ffffffff8161a164&gt;] ? __do_page_fault+0x2a4/0x4e0
[  324.984420]  [&lt;ffffffff8161665c&gt;] ? retint_restore_args+0xe/0xe
[  324.984420]  [&lt;ffffffff816166cd&gt;] ? retint_signal+0x11/0x84
[  324.984420]  [&lt;ffffffff81043605&gt;] do_notify_resume+0x65/0x80
[  324.984420]  [&lt;ffffffff81616702&gt;] retint_signal+0x46/0x84
[  324.984420] ---[ end trace 442ec2f04db3771a ]---

Reported-by: Vince Weaver &lt;vincent.weaver@maine.edu&gt;
Signed-off-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Suggested-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Corey Ashford &lt;cjashfor@linux.vnet.ibm.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Signed-off-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lkml.kernel.org/r/1373384651-6109-2-git-send-email-jolsa@redhat.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>perf: Clone child context from parent context pmu</title>
<updated>2013-07-28T23:25:48Z</updated>
<author>
<name>Jiri Olsa</name>
<email>jolsa@redhat.com</email>
</author>
<published>2013-07-09T15:44:10Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c4c6a6ea3adbe790d81ef72f623e22591704fdb9'/>
<id>urn:sha1:c4c6a6ea3adbe790d81ef72f623e22591704fdb9</id>
<content type='text'>
commit 734df5ab549ca44f40de0f07af1c8803856dfb18 upstream.

Currently when the child context for inherited events is
created, it's based on the pmu object of the first event
of the parent context.

This is wrong for the following scenario:

  - HW context having HW and SW event
  - HW event got removed (closed)
  - SW event stays in HW context as the only event
    and its pmu is used to clone the child context

The issue starts when the cpu context object is touched
based on the pmu context object (__get_cpu_context). In
this case the HW context will work with SW cpu context
ending up with following WARN below.

Fixing this by using parent context pmu object to clone
from child context.

Addresses the following warning reported by Vince Weaver:

[ 2716.472065] ------------[ cut here ]------------
[ 2716.476035] WARNING: at kernel/events/core.c:2122 task_ctx_sched_out+0x3c/0x)
[ 2716.476035] Modules linked in: nfsd auth_rpcgss oid_registry nfs_acl nfs locn
[ 2716.476035] CPU: 0 PID: 3164 Comm: perf_fuzzer Not tainted 3.10.0-rc4 #2
[ 2716.476035] Hardware name: AOpen   DE7000/nMCP7ALPx-DE R1.06 Oct.19.2012, BI2
[ 2716.476035]  0000000000000000 ffffffff8102e215 0000000000000000 ffff88011fc18
[ 2716.476035]  ffff8801175557f0 0000000000000000 ffff880119fda88c ffffffff810ad
[ 2716.476035]  ffff880119fda880 ffffffff810af02a 0000000000000009 ffff880117550
[ 2716.476035] Call Trace:
[ 2716.476035]  [&lt;ffffffff8102e215&gt;] ? warn_slowpath_common+0x5b/0x70
[ 2716.476035]  [&lt;ffffffff810ab2bd&gt;] ? task_ctx_sched_out+0x3c/0x5f
[ 2716.476035]  [&lt;ffffffff810af02a&gt;] ? perf_event_exit_task+0xbf/0x194
[ 2716.476035]  [&lt;ffffffff81032a37&gt;] ? do_exit+0x3e7/0x90c
[ 2716.476035]  [&lt;ffffffff810cd5ab&gt;] ? __do_fault+0x359/0x394
[ 2716.476035]  [&lt;ffffffff81032fe6&gt;] ? do_group_exit+0x66/0x98
[ 2716.476035]  [&lt;ffffffff8103dbcd&gt;] ? get_signal_to_deliver+0x479/0x4ad
[ 2716.476035]  [&lt;ffffffff810ac05c&gt;] ? __perf_event_task_sched_out+0x230/0x2d1
[ 2716.476035]  [&lt;ffffffff8100205d&gt;] ? do_signal+0x3c/0x432
[ 2716.476035]  [&lt;ffffffff810abbf9&gt;] ? ctx_sched_in+0x43/0x141
[ 2716.476035]  [&lt;ffffffff810ac2ca&gt;] ? perf_event_context_sched_in+0x7a/0x90
[ 2716.476035]  [&lt;ffffffff810ac311&gt;] ? __perf_event_task_sched_in+0x31/0x118
[ 2716.476035]  [&lt;ffffffff81050dd9&gt;] ? mmdrop+0xd/0x1c
[ 2716.476035]  [&lt;ffffffff81051a39&gt;] ? finish_task_switch+0x7d/0xa6
[ 2716.476035]  [&lt;ffffffff81002473&gt;] ? do_notify_resume+0x20/0x5d
[ 2716.476035]  [&lt;ffffffff813654f5&gt;] ? retint_signal+0x3d/0x78
[ 2716.476035] ---[ end trace 827178d8a5966c3d ]---

Reported-by: Vince Weaver &lt;vincent.weaver@maine.edu&gt;
Signed-off-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Corey Ashford &lt;cjashfor@linux.vnet.ibm.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Signed-off-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lkml.kernel.org/r/1373384651-6109-1-git-send-email-jolsa@redhat.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>perf: Fix mmap() accounting hole</title>
<updated>2013-07-03T17:59:06Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2013-06-04T08:44:21Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=703197b61d05f5edae54bad3256901c5a5c8794c'/>
<id>urn:sha1:703197b61d05f5edae54bad3256901c5a5c8794c</id>
<content type='text'>
commit 9bb5d40cd93c9dd4be74834b1dcb1ba03629716b upstream.

Vince's fuzzer once again found holes. This time it spotted a leak in
the locked page accounting.

When an event had redirected output and its close() was the last
reference to the buffer we didn't have a vm context to undo accounting.

Change the code to destroy the buffer on the last munmap() and detach
all redirected events at that time. This provides us the right context
to undo the vm accounting.

[Backporting for 3.4-stable.
VM_RESERVED flag was replaced with pair 'VM_DONTEXPAND | VM_DONTDUMP' in
314e51b9 since 3.7.0-rc1, and 314e51b9 comes from a big patchset, we didn't
backport the patchset, so I restored 'VM_DNOTEXPAND | VM_DONTDUMP' as before:
-	vma-&gt;vm_flags |= VM_DONTCOPY | VM_DONTEXPAND | VM_DONTDUMP;
+	vma-&gt;vm_flags |= VM_DONTCOPY | VM_RESERVED;
 -- zliu]

Reported-and-tested-by: Vince Weaver &lt;vincent.weaver@maine.edu&gt;
Signed-off-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lkml.kernel.org/r/20130604084421.GI8923@twins.programming.kicks-ass.net
Cc: &lt;stable@kernel.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Zhouping Liu &lt;zliu@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>perf: Fix perf mmap bugs</title>
<updated>2013-07-03T17:59:06Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2013-05-28T08:55:48Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=535fad87e86d33ea41d4b8580fadf62f5865ae6b'/>
<id>urn:sha1:535fad87e86d33ea41d4b8580fadf62f5865ae6b</id>
<content type='text'>
commit 26cb63ad11e04047a64309362674bcbbd6a6f246 upstream.

Vince reported a problem found by his perf specific trinity
fuzzer.

Al noticed 2 problems with perf's mmap():

 - it has issues against fork() since we use vma-&gt;vm_mm for accounting.
 - it has an rb refcount leak on double mmap().

We fix the issues against fork() by using VM_DONTCOPY; I don't
think there's code out there that uses this; we didn't hear
about weird accounting problems/crashes. If we do need this to
work, the previously proposed VM_PINNED could make this work.

Aside from the rb reference leak spotted by Al, Vince's example
prog was indeed doing a double mmap() through the use of
perf_event_set_output().

This exposes another problem, since we now have 2 events with
one buffer, the accounting gets screwy because we account per
event. Fix this by making the buffer responsible for its own
accounting.

[Backporting for 3.4-stable.
VM_RESERVED flag was replaced with pair 'VM_DONTEXPAND | VM_DONTDUMP' in
314e51b9 since 3.7.0-rc1, and 314e51b9 comes from a big patchset, we didn't
backport the patchset, so I restored 'VM_DNOTEXPAND | VM_DONTDUMP' as before:
-       vma-&gt;vm_flags |= VM_DONTCOPY | VM_DONTEXPAND | VM_DONTDUMP;
+       vma-&gt;vm_flags |= VM_DONTCOPY | VM_RESERVED;
 -- zliu]

Reported-by: Vince Weaver &lt;vincent.weaver@maine.edu&gt;
Signed-off-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@ghostprotocols.net&gt;
Link: http://lkml.kernel.org/r/20130528085548.GA12193@twins.programming.kicks-ass.net
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Zhouping Liu &lt;zliu@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
</feed>
