<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/kernel/events/core.c, branch v3.11.2</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.11.2</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.11.2'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2013-07-18T19:48:40Z</updated>
<entry>
<title>Merge tag 'driver-core-3.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core</title>
<updated>2013-07-18T19:48:40Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-07-18T19:48:40Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7a62711aacda8887d94c40daa199b37abb1d54e1'/>
<id>urn:sha1:7a62711aacda8887d94c40daa199b37abb1d54e1</id>
<content type='text'>
Pull driver core patches from Greg KH:
 "Here are some driver core patches for 3.11-rc2.  They aren't really
  bugfixes, but a bunch of new helper macros for drivers to properly
  create attribute groups, which drivers and subsystems need to fix up a
  ton of race issues with incorrectly creating sysfs files (binary and
  normal) after userspace has been told that the device is present.

  Also here is the ability to create binary files as attribute groups,
  to solve that race condition, which was impossible to do before this,
  so that's my fault the drivers were broken.

  The majority of the .c changes is indenting and moving code around a
  bit.  It affects no existing code, but allows the large backlog of 70+
  patches that I already have created to start flowing into the
  different subtrees, instead of having to live in my driver-core tree,
  causing merge nightmares in linux-next for the next few months.

  These were finalized too late for the -rc1 merge window, which is why
  they were didn't make that pull request, testing and review from
  others didn't happen until a few weeks ago, and then there's the whole
  distraction of the past few days, which prevented these from getting
  to you sooner, sorry about that.

  Oh, and there's a bugfix for the documentation build warning in here
  as well.  All of these have been in linux-next this week, with no
  reported problems"

* tag 'driver-core-3.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
  driver-core: fix new kernel-doc warning in base/platform.c
  sysfs: use file mode defines from stat.h
  sysfs: add more helper macro's for (bin_)attribute(_groups)
  driver core: add default groups to struct class
  driver core: Introduce device_create_groups
  sysfs: prevent warning when only using binary attributes
  sysfs: add support for binary attributes in groups
  driver core: device.h: add RW and RO attribute macros
  sysfs.h: add BIN_ATTR macro
  sysfs.h: add ATTRIBUTE_GROUPS() macro
  sysfs.h: add __ATTR_RW() macro
</content>
</entry>
<entry>
<title>sysfs.h: add __ATTR_RW() macro</title>
<updated>2013-07-16T17:57:36Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2013-07-14T23:05:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b9b3259746d77f4fcb786e2a43c25bcc40773755'/>
<id>urn:sha1:b9b3259746d77f4fcb786e2a43c25bcc40773755</id>
<content type='text'>
A number of parts of the kernel created their own version of this, might
as well have the sysfs core provide it instead.

Reviewed-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Tested-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kernel: delete __cpuinit usage from all core kernel files</title>
<updated>2013-07-14T23:36:59Z</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2013-06-19T18:53:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0db0628d90125193280eabb501c94feaf48fa9ab'/>
<id>urn:sha1:0db0628d90125193280eabb501c94feaf48fa9ab</id>
<content type='text'>
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications.  For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.

After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out.  Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.

This removes all the uses of the __cpuinit macros from C files in
the core kernel directories (kernel, init, lib, mm, and include)
that don't really have a specific maintainer.

[1] https://lkml.org/lkml/2013/5/20/589

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>perf: Fix perf_lock_task_context() vs RCU</title>
<updated>2013-07-12T09:11:09Z</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.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=058ebd0eba3aff16b144eabf4510ed9510e1416e'/>
<id>urn:sha1:058ebd0eba3aff16b144eabf4510ed9510e1416e</id>
<content type='text'>
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;
Cc: &lt;stable@kernel.org&gt;
Signed-off-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf: Remove WARN_ON_ONCE() check in __perf_event_enable() for valid scenario</title>
<updated>2013-07-12T09:11:01Z</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.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=06f417968beac6e6b614e17b37d347aa6a6b1d30'/>
<id>urn:sha1:06f417968beac6e6b614e17b37d347aa6a6b1d30</id>
<content type='text'>
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;
Cc: &lt;stable@kernel.org&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;
</content>
</entry>
<entry>
<title>perf: Clone child context from parent context pmu</title>
<updated>2013-07-12T09:10:47Z</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.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=734df5ab549ca44f40de0f07af1c8803856dfb18'/>
<id>urn:sha1:734df5ab549ca44f40de0f07af1c8803856dfb18</id>
<content type='text'>
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;
Cc: &lt;stable@kernel.org&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;
</content>
</entry>
<entry>
<title>perf: Fix interrupt handler timing harness</title>
<updated>2013-07-05T06:54:43Z</updated>
<author>
<name>Stephane Eranian</name>
<email>eranian@google.com</email>
</author>
<published>2013-07-04T22:30:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e5302920da9ef23f9d19d4e9ac85704cc25bee7a'/>
<id>urn:sha1:e5302920da9ef23f9d19d4e9ac85704cc25bee7a</id>
<content type='text'>
This patch fixes a serious bug in:

  14c63f17b1fd perf: Drop sample rate when sampling is too slow

There was an misunderstanding on the API of the do_div()
macro. It returns the remainder of the division and this
was not what the function expected leading to disabling the
interrupt latency watchdog.

This patch also remove a duplicate assignment in
perf_sample_event_took().

Signed-off-by: Stephane Eranian &lt;eranian@google.com&gt;
Cc: peterz@infradead.org
Cc: dave.hansen@linux.intel.com
Cc: ak@linux.intel.com
Cc: jolsa@redhat.com
Link: http://lkml.kernel.org/r/20130704223010.GA30625@quad
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf: Drop sample rate when sampling is too slow</title>
<updated>2013-06-23T09:52:57Z</updated>
<author>
<name>Dave Hansen</name>
<email>dave.hansen@linux.intel.com</email>
</author>
<published>2013-06-21T15:51:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=14c63f17b1fde5a575a28e96547a22b451c71fb5'/>
<id>urn:sha1:14c63f17b1fde5a575a28e96547a22b451c71fb5</id>
<content type='text'>
This patch keeps track of how long perf's NMI handler is taking,
and also calculates how many samples perf can take a second.  If
the sample length times the expected max number of samples
exceeds a configurable threshold, it drops the sample rate.

This way, we don't have a runaway sampling process eating up the
CPU.

This patch can tend to drop the sample rate down to level where
perf doesn't work very well.  *BUT* the alternative is that my
system hangs because it spends all of its time handling NMIs.

I'll take a busted performance tool over an entire system that's
busted and undebuggable any day.

BTW, my suspicion is that there's still an underlying bug here.
Using the HPET instead of the TSC is definitely a contributing
factor, but I suspect there are some other things going on.
But, I can't go dig down on a bug like that with my machine
hanging all the time.

Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: paulus@samba.org
Cc: acme@ghostprotocols.net
Cc: Dave Hansen &lt;dave@sr71.net&gt;
[ Prettified it a bit. ]
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf: Add const qualifier to perf_pmu_register's 'name' arg</title>
<updated>2013-06-19T10:50:23Z</updated>
<author>
<name>Mischa Jonker</name>
<email>Mischa.Jonker@synopsys.com</email>
</author>
<published>2013-06-04T09:45:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=03d8e80beb7db78a13c192431205b9c83f7e0cd1'/>
<id>urn:sha1:03d8e80beb7db78a13c192431205b9c83f7e0cd1</id>
<content type='text'>
This allows us to use pdev-&gt;name for registering a PMU device.
IMO the name is not supposed to be changed anyway.

Signed-off-by: Mischa Jonker &lt;mjonker@synopsys.com&gt;
Signed-off-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lkml.kernel.org/r/1370339148-5566-1-git-send-email-mjonker@synopsys.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf: Fix hypervisor branch sampling permission check</title>
<updated>2013-06-19T10:50:21Z</updated>
<author>
<name>Stephane Eranian</name>
<email>eranian@google.com</email>
</author>
<published>2013-06-06T09:02:04Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e712209a9e0b70e78b13847738eb66fe37412515'/>
<id>urn:sha1:e712209a9e0b70e78b13847738eb66fe37412515</id>
<content type='text'>
Commit 2b923c8 perf/x86: Check branch sampling priv level in generic code
was missing the check for the hypervisor (HV) priv level, so add it back.

With this patch, we get the following correct behavior:

  # echo 2 &gt;/proc/sys/kernel/perf_event_paranoid

  $ perf record -j any,k noploop 1
  Error:
  You may not have permission to collect stats.
  Consider tweaking /proc/sys/kernel/perf_event_paranoid:
   -1 - Not paranoid at all
    0 - Disallow raw tracepoint access for unpriv
    1 - Disallow cpu events for unpriv
    2 - Disallow kernel profiling for unpriv

   $ perf record -j any,hv noploop 1
   Error:
   You may not have permission to collect stats.
   Consider tweaking /proc/sys/kernel/perf_event_paranoid:
    -1 - Not paranoid at all
     0 - Disallow raw tracepoint access for unpriv
     1 - Disallow cpu events for unpriv
     2 - Disallow kernel profiling for unpriv

Signed-off-by: Stephane Eranian &lt;eranian@google.com&gt;
Acked-by: Petr Matousek &lt;pmatouse@redhat.com&gt;
Signed-off-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lkml.kernel.org/r/20130606090204.GA3725@quad
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
</feed>
