<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/events/core.c, branch v3.16</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.16</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.16'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2014-07-16T11:18:42Z</updated>
<entry>
<title>perf: Fix lockdep warning on process exit</title>
<updated>2014-07-16T11:18:42Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2014-06-23T14:12:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4a1c0f262f88e2676fda80a6bf80e7dbccae1dcb'/>
<id>urn:sha1:4a1c0f262f88e2676fda80a6bf80e7dbccae1dcb</id>
<content type='text'>
Sasha Levin reported:

&gt; While fuzzing with trinity inside a KVM tools guest running the latest -next
&gt; kernel I've stumbled on the following spew:
&gt;
&gt; ======================================================
&gt; [ INFO: possible circular locking dependency detected ]
&gt; 3.15.0-next-20140613-sasha-00026-g6dd125d-dirty #654 Not tainted
&gt; -------------------------------------------------------
&gt; trinity-c578/9725 is trying to acquire lock:
&gt; (&amp;(&amp;pool-&gt;lock)-&gt;rlock){-.-...}, at: __queue_work (kernel/workqueue.c:1346)
&gt;
&gt; but task is already holding lock:
&gt; (&amp;ctx-&gt;lock){-.....}, at: perf_event_exit_task (kernel/events/core.c:7471 kernel/events/core.c:7533)
&gt;
&gt; which lock already depends on the new lock.

&gt; 1 lock held by trinity-c578/9725:
&gt; #0: (&amp;ctx-&gt;lock){-.....}, at: perf_event_exit_task (kernel/events/core.c:7471 kernel/events/core.c:7533)
&gt;
&gt;  Call Trace:
&gt;  dump_stack (lib/dump_stack.c:52)
&gt;  print_circular_bug (kernel/locking/lockdep.c:1216)
&gt;  __lock_acquire (kernel/locking/lockdep.c:1840 kernel/locking/lockdep.c:1945 kernel/locking/lockdep.c:2131 kernel/locking/lockdep.c:3182)
&gt;  lock_acquire (./arch/x86/include/asm/current.h:14 kernel/locking/lockdep.c:3602)
&gt;  _raw_spin_lock (include/linux/spinlock_api_smp.h:143 kernel/locking/spinlock.c:151)
&gt;  __queue_work (kernel/workqueue.c:1346)
&gt;  queue_work_on (kernel/workqueue.c:1424)
&gt;  free_object (lib/debugobjects.c:209)
&gt;  __debug_check_no_obj_freed (lib/debugobjects.c:715)
&gt;  debug_check_no_obj_freed (lib/debugobjects.c:727)
&gt;  kmem_cache_free (mm/slub.c:2683 mm/slub.c:2711)
&gt;  free_task (kernel/fork.c:221)
&gt;  __put_task_struct (kernel/fork.c:250)
&gt;  put_ctx (include/linux/sched.h:1855 kernel/events/core.c:898)
&gt;  perf_event_exit_task (kernel/events/core.c:907 kernel/events/core.c:7478 kernel/events/core.c:7533)
&gt;  do_exit (kernel/exit.c:766)
&gt;  do_group_exit (kernel/exit.c:884)
&gt;  get_signal_to_deliver (kernel/signal.c:2347)
&gt;  do_signal (arch/x86/kernel/signal.c:698)
&gt;  do_notify_resume (arch/x86/kernel/signal.c:751)
&gt;  int_signal (arch/x86/kernel/entry_64.S:600)

Urgh.. so the only way I can make that happen is through:

  perf_event_exit_task_context()
    raw_spin_lock(&amp;child_ctx-&gt;lock);
    unclone_ctx(child_ctx)
      put_ctx(ctx-&gt;parent_ctx);
    raw_spin_unlock_irqrestore(&amp;child_ctx-&gt;lock);

And we can avoid this by doing the change below.

I can't immediately see how this changed recently, but given that you
say it's easy to reproduce, lets fix this.

Reported-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Signed-off-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Dave Jones &lt;davej@redhat.com&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@kernel.org&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Link: http://lkml.kernel.org/r/20140623141242.GB19860@laptop.programming.kicks-ass.net
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf: Revert ("perf: Always destroy groups on exit")</title>
<updated>2014-07-16T11:18:39Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2014-07-15T15:27:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1903d50cba54261a6562a476c05085f3d7a54097'/>
<id>urn:sha1:1903d50cba54261a6562a476c05085f3d7a54097</id>
<content type='text'>
Vince reported that commit 15a2d4de0eab5 ("perf: Always destroy groups
on exit") causes a regression with grouped events. In particular his
read_group_attached.c test fails.

  https://github.com/deater/perf_event_tests/blob/master/tests/bugs/read_group_attached.c

Because of the context switch optimization in
perf_event_context_sched_out() the 'original' event may end up in the
child process and when that exits the change in the patch in question
destroys the actual grouping.

Therefore revert that change and only destroy inherited groups.

Reported-by: Vince Weaver &lt;vincent.weaver@maine.edu&gt;
Signed-off-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@kernel.org&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Link: http://lkml.kernel.org/n/tip-zedy3uktcp753q8fw8dagx7a@git.kernel.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf: Do not allow optimized switch for non-cloned events</title>
<updated>2014-07-02T06:35:56Z</updated>
<author>
<name>Jiri Olsa</name>
<email>jolsa@redhat.com</email>
</author>
<published>2014-06-24T08:20:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1f9a7268c67f0290837aada443d28fd953ddca90'/>
<id>urn:sha1:1f9a7268c67f0290837aada443d28fd953ddca90</id>
<content type='text'>
The context check in perf_event_context_sched_out allows
non-cloned context to be part of the optimized schedule
out switch.

This could move non-cloned context into another workload
child. Once this child exits, the context is closed and
leaves all original (parent) events in closed state.

Any other new cloned event will have closed state and not
measure anything. And probably causing other odd bugs.

Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Signed-off-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@kernel.org&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Corey Ashford &lt;cjashfor@linux.vnet.ibm.com&gt;
Cc: David Ahern &lt;dsahern@gmail.com&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Link: http://lkml.kernel.org/r/1403598026-2310-2-git-send-email-jolsa@kernel.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'perf/core' into perf/urgent, to pick up the latest fixes</title>
<updated>2014-06-14T12:10:08Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@kernel.org</email>
</author>
<published>2014-06-14T12:10:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cf230918cda19532e4a5cc4f0d5c82fa7e5e94f6'/>
<id>urn:sha1:cf230918cda19532e4a5cc4f0d5c82fa7e5e94f6</id>
<content type='text'>
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2014-06-13T02:18:49Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2014-06-13T02:18:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3737a12761636ebde0f09ef49daebb8eed18cc8a'/>
<id>urn:sha1:3737a12761636ebde0f09ef49daebb8eed18cc8a</id>
<content type='text'>
Pull more perf updates from Ingo Molnar:
 "A second round of perf updates:

   - wide reaching kprobes sanitization and robustization, with the hope
     of fixing all 'probe this function crashes the kernel' bugs, by
     Masami Hiramatsu.

   - uprobes updates from Oleg Nesterov: tmpfs support, corner case
     fixes and robustization work.

   - perf tooling updates and fixes from Jiri Olsa, Namhyung Ki, Arnaldo
     et al:
        * Add support to accumulate hist periods (Namhyung Kim)
        * various fixes, refactorings and enhancements"

* 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (101 commits)
  perf: Differentiate exec() and non-exec() comm events
  perf: Fix perf_event_comm() vs. exec() assumption
  uprobes/x86: Rename arch_uprobe-&gt;def to -&gt;defparam, minor comment updates
  perf/documentation: Add description for conditional branch filter
  perf/x86: Add conditional branch filtering support
  perf/tool: Add conditional branch filter 'cond' to perf record
  perf: Add new conditional branch filter 'PERF_SAMPLE_BRANCH_COND'
  uprobes: Teach copy_insn() to support tmpfs
  uprobes: Shift -&gt;readpage check from __copy_insn() to uprobe_register()
  perf/x86: Use common PMU interrupt disabled code
  perf/ARM: Use common PMU interrupt disabled code
  perf: Disable sampled events if no PMU interrupt
  perf: Fix use after free in perf_remove_from_context()
  perf tools: Fix 'make help' message error
  perf record: Fix poll return value propagation
  perf tools: Move elide bool into perf_hpp_fmt struct
  perf tools: Remove elide setup for SORT_MODE__MEMORY mode
  perf tools: Fix "==" into "=" in ui_browser__warning assignment
  perf tools: Allow overriding sysfs and proc finding with env var
  perf tools: Consider header files outside perf directory in tags target
  ...
</content>
</entry>
<entry>
<title>Merge branch 'for-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup</title>
<updated>2014-06-09T22:03:33Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2014-06-09T22:03:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=14208b0ec56919f5333dd654b1a7d10765d0ad05'/>
<id>urn:sha1:14208b0ec56919f5333dd654b1a7d10765d0ad05</id>
<content type='text'>
Pull cgroup updates from Tejun Heo:
 "A lot of activities on cgroup side.  Heavy restructuring including
  locking simplification took place to improve the code base and enable
  implementation of the unified hierarchy, which currently exists behind
  a __DEVEL__ mount option.  The core support is mostly complete but
  individual controllers need further work.  To explain the design and
  rationales of the the unified hierarchy

        Documentation/cgroups/unified-hierarchy.txt

  is added.

  Another notable change is css (cgroup_subsys_state - what each
  controller uses to identify and interact with a cgroup) iteration
  update.  This is part of continuing updates on css object lifetime and
  visibility.  cgroup started with reference count draining on removal
  way back and is now reaching a point where csses behave and are
  iterated like normal refcnted objects albeit with some complexities to
  allow distinguishing the state where they're being deleted.  The css
  iteration update isn't taken advantage of yet but is planned to be
  used to simplify memcg significantly"

* 'for-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: (77 commits)
  cgroup: disallow disabled controllers on the default hierarchy
  cgroup: don't destroy the default root
  cgroup: disallow debug controller on the default hierarchy
  cgroup: clean up MAINTAINERS entries
  cgroup: implement css_tryget()
  device_cgroup: use css_has_online_children() instead of has_children()
  cgroup: convert cgroup_has_live_children() into css_has_online_children()
  cgroup: use CSS_ONLINE instead of CGRP_DEAD
  cgroup: iterate cgroup_subsys_states directly
  cgroup: introduce CSS_RELEASED and reduce css iteration fallback window
  cgroup: move cgroup-&gt;serial_nr into cgroup_subsys_state
  cgroup: link all cgroup_subsys_states in their sibling lists
  cgroup: move cgroup-&gt;sibling and -&gt;children into cgroup_subsys_state
  cgroup: remove cgroup-&gt;parent
  device_cgroup: remove direct access to cgroup-&gt;children
  memcg: update memcg_has_children() to use css_next_child()
  memcg: remove tasks/children test from mem_cgroup_force_empty()
  cgroup: remove css_parent()
  cgroup: skip refcnting on normal root csses and cgrp_dfl_root self css
  cgroup: use cgroup-&gt;self.refcnt for cgroup refcnting
  ...
</content>
</entry>
<entry>
<title>Revert "perf: Disable PERF_RECORD_MMAP2 support"</title>
<updated>2014-06-09T11:34:46Z</updated>
<author>
<name>Don Zickus</name>
<email>dzickus@redhat.com</email>
</author>
<published>2014-05-30T14:49:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a5a5ba72843dd05f991184d6cb9a4471acce1005'/>
<id>urn:sha1:a5a5ba72843dd05f991184d6cb9a4471acce1005</id>
<content type='text'>
This reverts commit 3090ffb5a2515990182f3f55b0688a7817325488.

Re-enable the mmap2 interface as we will have a user soon.

Since things have changed since perf disabled mmap2, small tweaks
to the revert had to be done:

o commit 9d4ecc88 forced (n!=8) to become (n&lt;7)
o a new libunwind test needed updating to use mmap2 interface

Signed-off-by: Don Zickus &lt;dzickus@redhat.com&gt;
Link: http://lkml.kernel.org/r/1401461382-209586-1-git-send-email-dzickus@redhat.com
Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf: Pass protection and flags bits through mmap2 interface</title>
<updated>2014-06-09T10:21:04Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2014-05-19T19:13:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f972eb63b1003fae68d7b7e9b674d4ba5db681c2'/>
<id>urn:sha1:f972eb63b1003fae68d7b7e9b674d4ba5db681c2</id>
<content type='text'>
The mmap2 interface was missing the protection and flags bits needed to
accurately determine if a mmap memory area was shared or private and
if it was readable or not.

Signed-off-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
[tweaked patch to compile and wrote changelog]
Signed-off-by: Don Zickus &lt;dzickus@redhat.com&gt;
Link: http://lkml.kernel.org/r/1400526833-141779-2-git-send-email-dzickus@redhat.com
Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf: Differentiate exec() and non-exec() comm events</title>
<updated>2014-06-06T05:56:22Z</updated>
<author>
<name>Adrian Hunter</name>
<email>adrian.hunter@intel.com</email>
</author>
<published>2014-05-28T08:45:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=82b897782d10fcc4930c9d4a15b175348fdd2871'/>
<id>urn:sha1:82b897782d10fcc4930c9d4a15b175348fdd2871</id>
<content type='text'>
perf tools like 'perf report' can aggregate samples by comm strings,
which generally works.  However, there are other potential use-cases.
For example, to pair up 'calls' with 'returns' accurately (from branch
events like Intel BTS) it is necessary to identify whether the process
has exec'd.  Although a comm event is generated when an 'exec' happens
it is also generated whenever the comm string is changed on a whim
(e.g. by prctl PR_SET_NAME).  This patch adds a flag to the comm event
to differentiate one case from the other.

In order to determine whether the kernel supports the new flag, a
selection bit named 'exec' is added to struct perf_event_attr.  The
bit does nothing but will cause perf_event_open() to fail if the bit
is set on kernels that do not have it defined.

Signed-off-by: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Signed-off-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lkml.kernel.org/r/537D9EBE.7030806@intel.com
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Dave Jones &lt;davej@redhat.com&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@kernel.org&gt;
Cc: David Ahern &lt;dsahern@gmail.com&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Alexander Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'perf/urgent' into perf/core, to resolve conflict and to prepare for new patches</title>
<updated>2014-06-06T05:55:06Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@kernel.org</email>
</author>
<published>2014-06-06T05:55:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ec00010972a0971b2c1da4fbe4e5c7d8ed1ecb05'/>
<id>urn:sha1:ec00010972a0971b2c1da4fbe4e5c7d8ed1ecb05</id>
<content type='text'>
Conflicts:
	arch/x86/kernel/traps.c

Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
</feed>
