Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757674Ab3HBDYV (ORCPT ); Thu, 1 Aug 2013 23:24:21 -0400 Received: from szxga01-in.huawei.com ([119.145.14.64]:62509 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756181Ab3HBDYT (ORCPT ); Thu, 1 Aug 2013 23:24:19 -0400 Message-ID: <51FB2651.206@huawei.com> Date: Fri, 2 Aug 2013 11:24:01 +0800 From: Li Zefan User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Tejun Heo CC: , , Subject: Re: [PATCHSET cgroup/for-3.12] cgroup: use cgroup_subsys_state as the primary subsystem interface handle References: <1375393801-4817-1-git-send-email-tj@kernel.org> In-Reply-To: <1375393801-4817-1-git-send-email-tj@kernel.org> Content-Type: text/plain; charset="GB2312" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.135.68.215] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3995 Lines: 78 On 2013/8/2 5:49, Tejun Heo wrote: > Hello, > > Currently, struct cgroup * is used as the main interface handle > between cgroup core and its subsystems, which works but is a bit > clunky because subsystems usually care much more about css's > (cgroup_subsys_state) a lot more than cgroups, which is natural as a > css is the intersection between a cgroup and a subsystem. > > In addition to being a bit clunky, dealing with cgroups directly pose > a bit of trouble for the planned unified hierarchy support on two > fronts. First, most iterations become subsystem dependent as task > membership is affected by which subtree has the specific subsystem > enabled and thus require specifying which subsystem the iteration is > for, which is automatically achieved if the interfaces deal with css's > instead of cgroups. > > Second, as css's may be created, attached, detached and destroyed > dynamically multiple times across the lifetime of a given cgroup as > they're enabled and disabled, which makes cgroup -> css mapping much > more difficult to synchronize. Giving out cgroup to subsystems and > then requiring them to take the extra steps to deal with their css's > coming and going dynamically is a lot more fragile than cgroup core > proper handling it internally and giving out the resulting css's to > subsystems. > > So, this patchset converts all cgroup subsystem APIs to deal with > css's instead of cgroups. The patchset is fairly large but most of > the conversions, while being tedious, aren't complex. At the end of > series, subsystems no longer make cgroup -> css mapping themselves and > cgroup_css() - formerly cgroup_subsys_state() - is made internal to > cgroup core proper. > > This is a rather large update to the interface and likely to play as a > barrier when porting commits, which is inconvenient but also provides > an opportunity to clean up the API where we can as doing so won't > significantly raise the level of inconvenience. As such, this > patchset contains some API cleanups and I'll probably follow up with > further API updates that I've been meaning to do and, if you have some > good idea to clean up cgroup internal API, this probably is a good > time to submit it. > > This patchset contains the following 23 patches. > > 0001-cgroup-s-cgroup_subsys_state-cgroup_css-s-task_subsy.patch > 0002-cpuset-drop-const-qualifiers-from-struct-cpuset-inst.patch > 0003-netprio_cgroup-pass-around-css-instead-of-cgroup-and.patch > 0004-hugetlb_cgroup-pass-around-hugetlb_cgroup-instead-of.patch > 0005-cgroup-add-subsystem-pointer-to-cgroup_subsys_state.patch > 0006-cgroup-add-update-accessors-which-obtain-subsys-spec.patch > 0007-cgroup-add-css_parent.patch > 0008-cgroup-pass-around-cgroup_subsys_state-instead-of-cg.patch > 0009-cgroup-add-subsys-backlink-pointer-to-cftype.patch > 0010-cgroup-pin-cgroup_subsys_state-when-opening-a-cgroup.patch > 0011-cgroup-add-cgroup-dummy_css.patch > 0012-cgroup-pass-around-cgroup_subsys_state-instead-of-cg.patch > 0013-cgroup-convert-cgroup_next_sibling-to-cgroup_next_ch.patch > 0014-cgroup-always-use-cgroup_next_child-to-walk-the-chil.patch > 0015-cgroup-make-hierarchy-iterators-deal-with-cgroup_sub.patch > 0016-cgroup-relocate-cgroup_advance_iter.patch > 0017-cgroup-rename-cgroup_iter-to-cgroup_task_iter.patch > 0018-cgroup-make-cgroup_task_iter-remember-the-cgroup-bei.patch > 0019-cgroup-remove-struct-cgroup_scanner.patch > 0020-cgroup-make-task-iterators-deal-with-cgroup_subsys_s.patch > 0021-cgroup-make-cftype-un-register_event-deal-with-cgrou.patch > 0022-cgroup-make-cgroup_taskset-deal-with-cgroup_subsys_s.patch > 0023-cgroup-unexport-cgroup_css.patch > Looks good to me! Acked-by: Li Zefan -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/