From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo 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 Message-ID: <1375992831-4650-1-git-send-email-tj@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=wsO+FQzqHVHhOjvY/GcI24vkx+TSJXD1qKLkrhSaPyY=; b=nM0sPvU4VKE3Ml4HxZXdJKSYnnZQkb/GCV2sv/EZEC44VZfJ58t7op+BE5wZrPvOVU 3Hg+BrPmR4DoC7dsrwicQKTbklMICEYV6ZKYvNa+x8lbFJS7hEvvhvwmwSTl5kpS5zR2 X4TfzV3O5QzxYsTqjzzsrSOaGKQf4/rtXIYX01J4We4PuHfhQJOl4NvWo9jdmS4vQ4bK xwaaUGziMfnwGaregheDewZkWWLJ7AFwvgC6P8lS56npPNo78lA7qB9NXqFhFr8VZ3nn Rwuwwwhywm2SJyG4w4dgklWOV5ktTaZPaP+rRCHuA0zV6X/VT8hseGNruE03gnGVT7bz nM/w== List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@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 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966364Ab3HHUOI (ORCPT ); Thu, 8 Aug 2013 16:14:08 -0400 Received: from mail-vc0-f176.google.com ([209.85.220.176]:56413 "EHLO mail-vc0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966197Ab3HHUOE (ORCPT ); Thu, 8 Aug 2013 16:14:04 -0400 From: Tejun Heo To: lizefan@huawei.com Cc: containers@lists.linux-foundation.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.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 Message-Id: <1375992831-4650-1-git-send-email-tj@kernel.org> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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