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
Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCHSET cgroup/for-3.12] cgroup: decouple cgroup_subsys_state lifetime from that of cgroup
Date: Thu,  8 Aug 2013 16:13:37 -0400	[thread overview]
Message-ID: <1375992831-4650-1-git-send-email-tj@kernel.org> (raw)

Hello,

Currently a css's (cgroup_subsys_state) lifetime is tied to that of
the cgroup it's attached to.  css's are created when the cgroup is
created and destroyed together.  The access rules depend on it too -
e.g. css's can be dereferenced while holding RCU read lock because
cgroup is protected with RCU.

With the planned unified hierarchy, we'll be dynamically creating and
destroying css's through the lifetime of a cgroup, so we can no longer
hitch css lifetime management onto cgroup's.  This patchset separates
out css lifetime management from that of cgroup.  After the patchset,
each css is individually RCU protected.

This patchset contains the following 14 patches.

 0001-cgroup-always-use-cgroup_css.patch
 0002-cgroup-rename-cgroup_subsys_state-dput_work-and-its-.patch
 0003-cgroup-add-cgroup_subsys_state-parent.patch
 0004-cgroup-cgroup_css_from_dir-now-should-be-called-with.patch
 0005-cgroup-make-cgroup_file_open-rcu_read_lock-around-cg.patch
 0006-cgroup-add-__rcu-modifier-to-cgroup-subsys.patch
 0007-cgroup-reorganize-css-init-exit-paths.patch
 0008-cgroup-move-cgroup-subsys-assignment-to-online_css.patch
 0009-cgroup-bounce-cgroup_subsys_state-ref-kill-confirmat.patch
 0010-cgroup-replace-cgroup-css_kill_cnt-with-nr_css.patch
 0011-cgroup-decouple-cgroup_subsys_state-destruction-from.patch
 0012-cgroup-factor-out-kill_css.patch
 0013-cgroup-move-subsys-file-removal-to-kill_css.patch
 0014-cgroup-RCU-protect-each-cgroup_subsys_state-release.patch

The patchset is on top of

  cgroup/for-3.12 61584e3f4 ("cgroup: Merge branch 'for-3.11-fixes' into for-3.12")
+ [1] cgroup: use cgroup_subsys_state as the primary subsystem interface handle
+ [2] cgroup: cgroup: make css_for_each_descendant() and friends include the origin css in the iteration

and available in the following branch.

 git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git review-rcufy-css

diffstat follows.

 include/linux/cgroup.h |   24 +-
 kernel/cgroup.c        |  423 +++++++++++++++++++++++++++++--------------------
 kernel/events/core.c   |    3
 3 files changed, 268 insertions(+), 182 deletions(-)

Thanks.

--
tejun

[1] https://lkml.org/lkml/2013/8/1/722
[2] https://lkml.org/lkml/2013/8/4/130

             reply	other threads:[~2013-08-08 20:13 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-08 20:13 Tejun Heo [this message]
2013-08-08 20:13 ` [PATCH 03/14] cgroup: add cgroup_subsys_state->parent Tejun Heo
2013-08-08 20:13 ` [PATCH 05/14] cgroup: make cgroup_file_open() rcu_read_lock() around cgroup_css() and add cfent->css Tejun Heo
     [not found] ` <1375992831-4650-1-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2013-08-08 20:13   ` [PATCH 01/14] cgroup: always use cgroup_css() Tejun Heo
2013-08-08 20:13   ` [PATCH 02/14] cgroup: rename cgroup_subsys_state->dput_work and its callback function Tejun Heo
2013-08-08 20:13   ` [PATCH 04/14] cgroup: cgroup_css_from_dir() now should be called with RCU read locked Tejun Heo
2013-08-08 20:13   ` [PATCH 06/14] cgroup: add __rcu modifier to cgroup->subsys[] Tejun Heo
2013-08-08 20:13   ` [PATCH 07/14] cgroup: reorganize css init / exit paths Tejun Heo
     [not found]     ` <1375992831-4650-8-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2013-08-12  2:47       ` Li Zefan
     [not found]         ` <52084CC5.8050207-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2013-08-12 13:39           ` Tejun Heo
2013-08-12 13:40       ` [PATCH v2 " Tejun Heo
2013-08-08 20:13   ` [PATCH 08/14] cgroup: move cgroup->subsys[] assignment to online_css() Tejun Heo
     [not found]     ` <1375992831-4650-9-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2013-08-14  0:27       ` [PATCH v2 " Tejun Heo
2013-08-08 20:13   ` [PATCH 09/14] cgroup: bounce cgroup_subsys_state ref kill confirmation to a work item Tejun Heo
2013-08-08 20:13   ` [PATCH 10/14] cgroup: replace cgroup->css_kill_cnt with ->nr_css Tejun Heo
2013-08-08 20:13   ` [PATCH 11/14] cgroup: decouple cgroup_subsys_state destruction from cgroup destruction Tejun Heo
2013-08-08 20:13   ` [PATCH 13/14] cgroup: move subsys file removal to kill_css() Tejun Heo
2013-08-13  1:19   ` [PATCHSET cgroup/for-3.12] cgroup: decouple cgroup_subsys_state lifetime from that of cgroup Li Zefan
2013-08-13 15:02   ` Tejun Heo
2013-08-08 20:13 ` [PATCH 12/14] cgroup: factor out kill_css() Tejun Heo
2013-08-08 20:13 ` [PATCH 14/14] cgroup: RCU protect each cgroup_subsys_state release 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=1375992831-4650-1-git-send-email-tj@kernel.org \
    --to=tj-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lizefan-hv44wF8Li93QT0dZR+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).