cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org,
	hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org,
	a.p.zijlstra-/NLkJaSkS4VmR6Xm/wNWPw@public.gmane.org,
	mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	acme-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	kernel-team-b10kYP2dOMg@public.gmane.org
Subject: [PATCHSET] cgroup, perf_event: make perf_event work on v2 hierarchy
Date: Thu,  7 Jan 2016 17:29:44 -0500	[thread overview]
Message-ID: <1452205790-21331-1-git-send-email-tj@kernel.org> (raw)

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

             reply	other threads:[~2016-01-07 22:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-07 22:29 Tejun Heo [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1452205790-21331-1-git-send-email-tj@kernel.org \
    --to=tj-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=a.p.zijlstra-/NLkJaSkS4VmR6Xm/wNWPw@public.gmane.org \
    --cc=acme-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
    --cc=kernel-team-b10kYP2dOMg@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).