<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/kernel/perf_event.c, branch linux-2.6.33.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.33.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.33.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2011-04-14T23:52:46Z</updated>
<entry>
<title>perf: Better fit max unprivileged mlock pages for tools needs</title>
<updated>2011-04-14T23:52:46Z</updated>
<author>
<name>Frederic Weisbecker</name>
</author>
<published>2011-03-23T18:29:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=202b227e0d99508b7b9dc56511e3ed7c21868ab5'/>
<id>urn:sha1:202b227e0d99508b7b9dc56511e3ed7c21868ab5</id>
<content type='text'>
commit 880f57318450dbead6a03f9e31a1468924d6dd88 upstream.

The maximum kilobytes of locked memory that an unprivileged user
can reserve is of 512 kB = 128 pages by default, scaled to the
number of onlined CPUs, which fits well with the tools that use
128 data pages by default.

However tools actually use 129 pages, because they need one more
for the user control page. Thus the default mlock threshold is
not sufficient for the default tools needs and we always end up
to evaluate the constant mlock rlimit policy, which doesn't have
this scaling with the number of online CPUs.

Hence, on systems that have more than 16 CPUs, we overlap the
rlimit threshold and fail to mmap:

	$ perf record ls
	Error: failed to mmap with 1 (Operation not permitted)

Just increase the max unprivileged mlock threshold by one page
so that it supports well perf tools even after 16 CPUs.

Reported-by: Han Pingtian &lt;phan@redhat.com&gt;
Reported-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Reported-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Acked-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
LKML-Reference: &lt;1300904979-5508-1-git-send-email-fweisbec@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>perf: Fix signed comparison in perf_adjust_period()</title>
<updated>2010-07-05T18:16:07Z</updated>
<author>
<name>Peter Zijlstra</name>
</author>
<published>2010-06-04T13:18:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e26e13a7e153ae645a430c4983241b0e9987d5cf'/>
<id>urn:sha1:e26e13a7e153ae645a430c4983241b0e9987d5cf</id>
<content type='text'>
commit f6ab91add6355e231e1c47897027b2a6ee4fa268 upstream.

Frederic reported that frequency driven swevents didn't work properly
and even caused a division-by-zero error.

It turns out there are two bugs, the division-by-zero comes from a
failure to deal with that in perf_calculate_period().

The other was more interesting and turned out to be a wrong comparison
in perf_adjust_period(). The comparison was between an s64 and u64 and
got implicitly converted to an unsigned comparison. The problem is
that period_left is typically &lt; 0, so it ended up being always true.

Cure this by making the local period variables s64.

Reported-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Tested-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
LKML-Reference: &lt;new-submission&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>Fix racy use of anon_inode_getfd() in perf_event.c</title>
<updated>2010-07-05T18:15:28Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2010-05-26T21:40:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b2bdae6d2cf82649fee2640adc334d41f5038185'/>
<id>urn:sha1:b2bdae6d2cf82649fee2640adc334d41f5038185</id>
<content type='text'>
commit ea635c64e007061f6468ece5cc9cc62d41d4ecf2 upstream.

once anon_inode_getfd() is called, you can't expect *anything* about
struct file that descriptor points to - another thread might be doing
whatever it likes with descriptor table at that point.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>perf: Fix resource leak in failure path of perf_event_open()</title>
<updated>2010-05-12T22:02:42Z</updated>
<author>
<name>Tejun Heo</name>
</author>
<published>2010-05-01T08:11:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0c41fcd0b738e0ac646e043ed47b7f642947b6a0'/>
<id>urn:sha1:0c41fcd0b738e0ac646e043ed47b7f642947b6a0</id>
<content type='text'>
commit 048c852051d2bd5da54a4488bc1f16b0fc74c695 upstream.

perf_event_open() kfrees event after init failure which doesn't
release all resources allocated by perf_event_alloc().  Use
free_event() instead.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Paul Mackerras &lt;paulus@au1.ibm.com&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
LKML-Reference: &lt;4BDBE237.1040809@kernel.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>perf_event: Fix oops triggered by cpu offline/online</title>
<updated>2010-04-01T23:01:30Z</updated>
<author>
<name>Paul Mackerras</name>
</author>
<published>2010-03-10T09:45:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=118c29f02194a7874cbbff605b2ec544b97d5610'/>
<id>urn:sha1:118c29f02194a7874cbbff605b2ec544b97d5610</id>
<content type='text'>
commit 220b140b52ab6cc133f674a7ffec8fa792054f25 upstream.

Anton Blanchard found that he could reliably make the kernel hit a
BUG_ON in the slab allocator by taking a cpu offline and then online
while a system-wide perf record session was running.

The reason is that when the cpu comes up, we completely reinitialize
the ctx field of the struct perf_cpu_context for the cpu.  If there is
a system-wide perf record session running, then there will be a struct
perf_event that has a reference to the context, so its refcount will
be 2.  (The perf_event has been removed from the context's group_entry
and event_entry lists by perf_event_exit_cpu(), but that doesn't
remove the perf_event's reference to the context and doesn't decrement
the context's refcount.)

When the cpu comes up, perf_event_init_cpu() gets called, and it calls
__perf_event_init_context() on the cpu's context.  That resets the
refcount to 1.  Then when the perf record session finishes and the
perf_event is closed, the refcount gets decremented to 0 and the
context gets kfreed after an RCU grace period.  Since the context
wasn't kmalloced -- it's part of a per-cpu variable -- bad things
happen.

In fact we don't need to completely reinitialize the context when the
cpu comes up.  It's sufficient to initialize the context once at boot,
but we need to do it for all possible cpus.

This moves the context initialization to happen at boot time.  With
this, we don't trash the refcount and the context never gets kfreed,
and we don't hit the BUG_ON.

Reported-by: Anton Blanchard &lt;anton@samba.org&gt;
Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt;
Tested-by: Anton Blanchard &lt;anton@samba.org&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>perf: Provide generic perf_sample_data initialization</title>
<updated>2010-04-01T23:01:29Z</updated>
<author>
<name>Peter Zijlstra</name>
</author>
<published>2010-03-19T01:00:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=06432c9591a2607d70580333a50aba19344e2e40'/>
<id>urn:sha1:06432c9591a2607d70580333a50aba19344e2e40</id>
<content type='text'>
This makes it easier to extend perf_sample_data and fixes a bug on arm
and sparc, which failed to set -&gt;raw to NULL, which can cause crashes
when combined with PERF_SAMPLE_RAW.

It also optimizes PowerPC and tracepoint, because the struct
initialization is forced to zero out the whole structure.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Acked-by: Jean Pihet &lt;jpihet@mvista.com&gt;
Reviewed-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Jamie Iles &lt;jamie.iles@picochip.com&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
LKML-Reference: &lt;20100304140100.315416040@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>perf: Reimplement frequency driven sampling</title>
<updated>2010-03-15T16:06:17Z</updated>
<author>
<name>Peter Zijlstra</name>
</author>
<published>2010-01-26T17:50:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=21a6adcde06e129b055caa3256e65a97a2986770'/>
<id>urn:sha1:21a6adcde06e129b055caa3256e65a97a2986770</id>
<content type='text'>
commit abd50713944c8ea9e0af5b7bffa0aacae21cc91a upstream.

There was a bug in the old period code that caused intel_pmu_enable_all()
or native_write_msr_safe() to show up quite high in the profiles.

In staring at that code it made my head hurt, so I rewrote it in a
hopefully simpler fashion. Its now fully symetric between tick and
overflow driven adjustments and uses less data to boot.

The only complication is that it basically wants to do a u128 division.
The code approximates that in a rather simple truncate until it fits
fashion, taking care to balance the terms while truncating.

This version does not generate that sampling artefact.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>perf_event: Fix preempt warning in perf_clock()</title>
<updated>2010-03-15T16:06:14Z</updated>
<author>
<name>Peter Zijlstra</name>
</author>
<published>2010-02-26T15:36:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fc0df425c936cca6e5a306c37b96bb1f8f15371c'/>
<id>urn:sha1:fc0df425c936cca6e5a306c37b96bb1f8f15371c</id>
<content type='text'>
commit 24691ea964cc0123e386b661e03a86a481c6ee79 upstream.

A recent commit introduced a preemption warning for
perf_clock(), use raw_smp_processor_id() to avoid this, it
really doesn't matter which cpu we use here.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
LKML-Reference: &lt;1267198583.22519.684.camel@laptop&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>perf_events: Fix FORK events</title>
<updated>2010-02-14T17:10:39Z</updated>
<author>
<name>Peter Zijlstra</name>
</author>
<published>2010-02-14T10:12:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6f93d0a7c83772997b81c30d6f519a9a5dbab6a9'/>
<id>urn:sha1:6f93d0a7c83772997b81c30d6f519a9a5dbab6a9</id>
<content type='text'>
Commit 22e19085 ("Honour event state for aux stream data")
introduced a bug where we would drop FORK events.

The thing is that we deliver FORK events to the child process'
event, which at that time will be PERF_EVENT_STATE_INACTIVE
because the child won't be scheduled in (we're in the middle of
fork).

Solve this twice, change the event state filter to exclude only
disabled (STATE_OFF) or worse, and deliver FORK events to the
current (parent).

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Anton Blanchard &lt;anton@samba.org&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@ghostprotocols.net&gt;
LKML-Reference: &lt;1266142324.5273.411.camel@laptop&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>perf: Make bp_len type to u64 generic across the arch</title>
<updated>2010-02-04T00:07:12Z</updated>
<author>
<name>Mahesh Salgaonkar</name>
</author>
<published>2010-01-30T04:55:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cd757645fbdc34a8343c04bb0e74e06fccc2cb10'/>
<id>urn:sha1:cd757645fbdc34a8343c04bb0e74e06fccc2cb10</id>
<content type='text'>
Change 'bp_len' type to __u64 to make it work across archs as
the s390 architecture watch point length can be upto 2^64.

reference:
	http://lkml.org/lkml/2010/1/25/212

This is an ABI change that is not backward compatible with
the previous hardware breakpoint info layout integrated in this
development cycle, a rebuilt of perf tools is necessary for
versions based on 2.6.33-rc1 - 2.6.33-rc6 to work with a
kernel based on this patch.

Signed-off-by: Mahesh Salgaonkar &lt;mahesh@linux.vnet.ibm.com&gt;
Acked-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Ananth N Mavinakayanahalli &lt;ananth@in.ibm.com&gt;
Cc: "K. Prasad" &lt;prasad@linux.vnet.ibm.com&gt;
Cc: Maneesh Soni &lt;maneesh@in.ibm.com&gt;
Cc: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Cc: Martin &lt;schwidefsky@de.ibm.com&gt;
LKML-Reference: &lt;20100130045518.GA20776@in.ibm.com&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
</content>
</entry>
</feed>
