aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/cls_cgroup.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-11-22 10:32:46 -0500
committerTejun Heo <tj@kernel.org>2012-11-22 10:32:46 -0500
commit0ba18f7a5e268e095f79e32b7b47e8ce4fbabbe2 (patch)
tree43bd8423515aeb6671c3b80ea3be3f07773d3c19 /net/sched/cls_cgroup.c
parentd0b2fdd2a51203f04ea0a5d716e033c15e0231af (diff)
netcls_cgroup: move config inheritance to ->css_online() and remove .broken_hierarchy marking
It turns out that we'll have to live with attributes which are inherited at cgroup creation time but not affected by further updates to the parent afterwards - such attributes are already in wide use e.g. for cpuset. So, there's nothing to do for netcls_cgroup for hierarchy support. Its current behavior - inherit only during creation - is good enough. Move config inheriting from ->css_alloc() to ->css_online() for consistency, which doesn't change behavior at all, and remove .broken_hierarchy marking. Signed-off-by: Tejun Heo <tj@kernel.org> Tested-and-Acked-by: Daniel Wagner <daniel.wagner@bmw-carit.de> Acked-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/cls_cgroup.c')
-rw-r--r--net/sched/cls_cgroup.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c
index 8cdc18e075fb..31f06b633574 100644
--- a/net/sched/cls_cgroup.c
+++ b/net/sched/cls_cgroup.c
@@ -41,11 +41,15 @@ static struct cgroup_subsys_state *cgrp_css_alloc(struct cgroup *cgrp)
41 cs = kzalloc(sizeof(*cs), GFP_KERNEL); 41 cs = kzalloc(sizeof(*cs), GFP_KERNEL);
42 if (!cs) 42 if (!cs)
43 return ERR_PTR(-ENOMEM); 43 return ERR_PTR(-ENOMEM);
44 return &cs->css;
45}
44 46
47static int cgrp_css_online(struct cgroup *cgrp)
48{
45 if (cgrp->parent) 49 if (cgrp->parent)
46 cs->classid = cgrp_cls_state(cgrp->parent)->classid; 50 cgrp_cls_state(cgrp)->classid =
47 51 cgrp_cls_state(cgrp->parent)->classid;
48 return &cs->css; 52 return 0;
49} 53}
50 54
51static void cgrp_css_free(struct cgroup *cgrp) 55static void cgrp_css_free(struct cgroup *cgrp)
@@ -76,19 +80,11 @@ static struct cftype ss_files[] = {
76struct cgroup_subsys net_cls_subsys = { 80struct cgroup_subsys net_cls_subsys = {
77 .name = "net_cls", 81 .name = "net_cls",
78 .css_alloc = cgrp_css_alloc, 82 .css_alloc = cgrp_css_alloc,
83 .css_online = cgrp_css_online,
79 .css_free = cgrp_css_free, 84 .css_free = cgrp_css_free,
80 .subsys_id = net_cls_subsys_id, 85 .subsys_id = net_cls_subsys_id,
81 .base_cftypes = ss_files, 86 .base_cftypes = ss_files,
82 .module = THIS_MODULE, 87 .module = THIS_MODULE,
83
84 /*
85 * While net_cls cgroup has the rudimentary hierarchy support of
86 * inheriting the parent's classid on cgroup creation, it doesn't
87 * properly propagates config changes in ancestors to their
88 * descendents. A child should follow the parent's configuration
89 * but be allowed to override it. Fix it and remove the following.
90 */
91 .broken_hierarchy = true,
92}; 88};
93 89
94struct cls_cgroup_head { 90struct cls_cgroup_head {