cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHSET] cgroup, perf_event: make perf_event work on v2 hierarchy
@ 2016-01-07 22:29 Tejun Heo
  2016-01-07 22:29 ` [PATCH 1/6] cgroup: s/cgrp_dfl_root_/cgrp_dfl_/ Tejun Heo
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Tejun Heo @ 2016-01-07 22:29 UTC (permalink / raw)
  To: lizefan-hv44wF8Li93QT0dZR+AlfA, hannes-druUgvl0LCNAfugRpC6u6w,
	a.p.zijlstra-/NLkJaSkS4VmR6Xm/wNWPw, mingo-H+wXaHxf7aLQT0dZR+AlfA,
	acme-DgEjT+Ai2ygdnm+yROfE0A
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	cgroups-u79uwXL29TY76Z2rM5mHXA, kernel-team-b10kYP2dOMg

Hello,

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 six patches.

 0001-cgroup-s-cgrp_dfl_root_-cgrp_dfl_.patch
 0002-cgroup-convert-cgroup_subsys-flag-fields-to-bool-bit.patch
 0003-cgroup-make-css_tryget_online_from_dir-also-recogniz.patch
 0004-cgroup-use-subtree_control-when-testing-no-internal-.patch
 0005-cgroup-implement-cgroup_subsys-implicit_on_dfl.patch
 0006-cgroup-perf_event-make-perf_event-controller-work-on.patch

0001-0004 are prep patches.

0005 implents implicit controller enabling.

0006 marks perf_event as implicitly enabled on v2 and updates "perf
record"

This patchset is on top of cgroup/for-4.5 and available in the
following git branch.

 git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git review-cgroup2-perf_event

diffstat follows.  Thanks.

 Documentation/cgroup.txt    |   13 ++++
 include/linux/cgroup-defs.h |   21 ++++++-
 kernel/cgroup.c             |  129 ++++++++++++++++++++++++++++++++++----------
 kernel/cpuset.c             |    2 
 kernel/events/core.c        |    6 ++
 kernel/sched/core.c         |    2 
 kernel/sched/cpuacct.c      |    2 
 tools/perf/util/cgroup.c    |   26 ++++++--
 8 files changed, 160 insertions(+), 41 deletions(-)

--
tejun

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-02-23 14:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-07 22:29 [PATCHSET] cgroup, perf_event: make perf_event work on v2 hierarchy Tejun Heo
2016-01-07 22:29 ` [PATCH 1/6] cgroup: s/cgrp_dfl_root_/cgrp_dfl_/ Tejun Heo
2016-01-07 22:29 ` [PATCH 2/6] cgroup: convert cgroup_subsys flag fields to bool bitfields Tejun Heo
2016-01-07 22:29 ` [PATCH 3/6] cgroup: make css_tryget_online_from_dir() also recognize cgroup2 fs Tejun Heo
2016-01-07 22:29 ` [PATCH 4/6] cgroup: use ->subtree_control when testing no internal process rule Tejun Heo
     [not found]   ` <1452205790-21331-5-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-02-23 14:59     ` Tejun Heo
2016-01-07 22:29 ` [PATCH 5/6] cgroup: implement cgroup_subsys->implicit_on_dfl Tejun Heo
2016-01-07 22:29 ` [PATCH 6/6] cgroup, perf_event: make perf_event controller work on cgroup2 hierarchy Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).