[PATCHSET v2 cgroup/for-4.6] cgroup, perf_event: make perf_event work on v2 hierarchy
From: Tejun Heo
Date: Wed Feb 24 2016 - 17:13:04 EST
Changes from v1 are
* cgroup prep patches are applied to cgroup/for-4.6.
* Implicit controller support is reimplemented on top of the modular
control mask update which makes it simpler and better behaved -
perf_event can now be returned to v2 hierarchy anytime.
perf_event is special in that while it primarily is there to identify
cgroup membership of tasks, it also keeps some per-cgroup state, so
unlike other controllers which are purely for identification, it can't
be replaced by v2 hierarchy membership tests. At the same time, as it
is primarily used for tagging, doesn't incur meaningful runtime
overhead and doesn't have any interface, it's awkward to control it
via the usual "cgroup.subtree_control" mechanism on the v2 hierarchy.
This patchset makes perf_event implicitly enabled on the v2 hierarchy
so that cgroup v2 path automatically works with "perf record --cgroup"
as long as perf_event controller is available and not mounted on a
legacy hierarchy. "perf record" is updated so that it searches for
both v1 hierarchy w/ perf_event on it and v2 hierarchy. The v1
hierarchy is used if exists; otherwise, v2 is used, making the
transition transparent to users.
This patchset contains the following two patches.
This patchset is on top of cgroup/for-4.6 and available in the
following git branch.
As the changes are heavily dependent on updates in cgroup core and
relatively well isolated on perf side, once acked, I think it'd be
best to route this through cgroup tree.
Documentation/cgroup-v2.txt | 12 ++++++++++++
include/linux/cgroup-defs.h | 13 +++++++++++++
kernel/cgroup.c | 38 +++++++++++++++++++++++++++++++-------
kernel/events/core.c | 6 ++++++
tools/perf/util/cgroup.c | 26 +++++++++++++++++++-------
5 files changed, 81 insertions(+), 14 deletions(-)