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: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCHSET v2 cgroup/for-3.15] cgroup: convert to kernfs
Date: Sat,  8 Feb 2014 11:15:14 -0500	[thread overview]
Message-ID: <1391876127-7134-1-git-send-email-tj@kernel.org> (raw)

Hello,

This is v2 of cgroup kernfs conversion patchset.  Changes from the
last take[L] are

* CONFIG_CGROUPS now selects CONFIG_KERNFS

* Handling of (!opts->subsys_mask && !opts->none) during mount has
  been updated so that mounting an existing hierarchy w/ only its name
  succeeds.

* __force cast added to RCU_INIT_POINTER() in cgroup_destroy_locked()
  to suppress sparse warning.

cgroup filesystem code was derived from the original sysfs
implementation which was heavily intertwined with vfs objects and
locking with the goal of re-using the existing vfs infrastructure.
That experiment turned out rather disastrous and sysfs switched, a
long time ago, to distributed filesystem model where a separate
representation is maintained which is queried by vfs.  Unfortunately,
cgroup stuck with the failed experiment all these years and
accumulated even more problems over time.

Locking and object lifetime management being entangled with vfs is
probably the most egregious.  vfs was never designed to be misused
like this and cgroup ends up jumping through various convoluted
dancing to make things work.  Even then, operations across multiple
cgroups can't be done safely as it'll deadlock with rename locking.

Recently, kernfs is separated out from sysfs so that it can be used by
users other than sysfs.  This patchset converts cgroup to use kernfs.
This simplifies code base quite a bit and allows further cleanups and
implementation of features which depend on operating across multiple
nodes.

This patchset contains the following 13 patches.

 0001-cgroup-improve-css_from_dir-into-css_tryget_from_dir.patch
 0002-cgroup-introduce-cgroup_tree_mutex.patch
 0003-cgroup-release-cgroup_mutex-over-file-removals.patch
 0004-cgroup-restructure-locking-and-error-handling-in-cgr.patch
 0005-cgroup-factor-out-cgroup_setup_root-from-cgroup_moun.patch
 0006-cgroup-update-cgroup-name-handling.patch
 0007-cgroup-make-cgroup_subsys-base_cftypes-use-cgroup_ad.patch
 0008-cgroup-update-the-meaning-of-cftype-max_write_len.patch
 0009-cgroup-introduce-cgroup_init-exit_cftypes.patch
 0010-cgroup-introduce-cgroup_ino.patch
 0011-cgroup-misc-preps-for-kernfs-conversion.patch
 0012-cgroup-relocate-functions-in-preparation-of-kernfs-c.patch
 0013-cgroup-convert-to-kernfs.patch

 0001 updates css_from_dir() into css_tryget_from_dir() so that the
 caller doesn't have to worry about RCU locking.

 0002-0004 introduce cgroup_tree_mutex and prepare locking.

 0005-0006 are misc preps.

 0007-0008 update cftype handling in preparation.

 0009-0012 are misc preps.

 0013 converts cgroup to kernfs.

This patchset is on top of cgroup/for-3.15 f7cef064aa01 ("Merge branch
'driver-core-next' into cgroup/for-3.15") and also available in the
following branch.

 git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git review-kernfs-conversion

diffstat follows.

 block/blk-throttle.c   |    4
 block/cfq-iosched.c    |    3
 include/linux/cgroup.h |   71 --
 init/Kconfig           |    1
 kernel/cgroup.c        | 1725 ++++++++++++++++++++-----------------------------
 kernel/events/core.c   |   17
 mm/memcontrol.c        |   16
 mm/memory-failure.c    |    8
 8 files changed, 766 insertions(+), 1079 deletions(-)

Thanks.

--
tejun

[L] http://lkml.kernel.org/g/1390953285-16360-1-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

             reply	other threads:[~2014-02-08 16:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-08 16:15 Tejun Heo [this message]
2014-02-08 16:15 ` [PATCH 07/13] cgroup: make cgroup_subsys->base_cftypes use cgroup_add_cftypes() Tejun Heo
2014-02-08 16:15 ` [PATCH 08/13] cgroup: update the meaning of cftype->max_write_len Tejun Heo
     [not found] ` <1391876127-7134-1-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2014-02-08 16:15   ` [PATCH 01/13] cgroup: improve css_from_dir() into css_tryget_from_dir() Tejun Heo
2014-02-08 16:15   ` [PATCH 02/13] cgroup: introduce cgroup_tree_mutex Tejun Heo
2014-02-08 16:15   ` [PATCH 03/13] cgroup: release cgroup_mutex over file removals Tejun Heo
2014-02-08 16:15   ` [PATCH 04/13] cgroup: restructure locking and error handling in cgroup_mount() Tejun Heo
2014-02-08 16:15   ` [PATCH 05/13] cgroup: factor out cgroup_setup_root() from cgroup_mount() Tejun Heo
2014-02-08 16:15   ` [PATCH 06/13] cgroup: update cgroup name handling Tejun Heo
2014-02-08 16:15   ` [PATCH 09/13] cgroup: introduce cgroup_init/exit_cftypes() Tejun Heo
2014-02-08 16:15   ` [PATCH 10/13] cgroup: introduce cgroup_ino() Tejun Heo
2014-02-08 16:15   ` [PATCH 11/13] cgroup: misc preps for kernfs conversion Tejun Heo
2014-02-08 16:15   ` [PATCH 13/13] cgroup: convert to kernfs Tejun Heo
2014-02-08 16:15 ` [PATCH 12/13] cgroup: relocate functions in preparation of kernfs conversion 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=1391876127-7134-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).