From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Wagner Subject: Re: [PATCH 7/7] netprio_cgroup: allow nesting and inherit config on cgroup creation Date: Tue, 20 Nov 2012 16:10:46 +0100 Message-ID: <50AB9D76.3010809@monom.org> References: <1353400211-5182-1-git-send-email-tj@kernel.org> <1353400211-5182-8-git-send-email-tj@kernel.org> <50AB45EA.2050507@monom.org> <20121120144036.GP15971@htj.dyndns.org> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20121120144036.GP15971-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org> 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 Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Tejun Heo Cc: nhorman-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org, tgraf-G/eBtMaohhA@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org Hi Tejun, On 20.11.2012 15:40, Tejun Heo wrote: > Hello, Daniel. > > On Tue, Nov 20, 2012 at 09:57:14AM +0100, Daniel Wagner wrote: >>> -static void cgrp_css_free(struct cgroup *cgrp) >>> +static int cgrp_css_online(struct cgroup *cgrp) >>> { >>> - struct cgroup_netprio_state *cs = cgrp_netprio_state(cgrp); >>> + struct cgroup *parent = cgrp->parent; >>> struct net_device *dev; >>> + int ret = 0; >>> + >>> + if (!parent) >>> + return 0; >> >> BTW, parent is always != NULL, because the root cgroup will be >> attached to the dummytop cgroup. > > Hmmm? I'm confused. When ->css_online() is called for dummytop in > cgroup_init_subsys(), its parent is NULL. What am I missing? Forget my comment, I was really confused when writing this. I was looking only at cgroups which were created after bootup. cheers, daniel