From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Hocko Subject: Re: [PATCH 1/8] cgroup: kill cgroup_subsys->__DEPRECATED_clear_css_refs Date: Wed, 31 Oct 2012 17:48:55 +0100 Message-ID: <20121031164855.GI22809@dhcp22.suse.cz> References: <1351657365-25055-1-git-send-email-tj@kernel.org> <1351657365-25055-2-git-send-email-tj@kernel.org> <20121031143751.GA22809@dhcp22.suse.cz> <20121031164123.GD2945@htj.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20121031164123.GD2945-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org> 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: Tejun Heo Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org List-Id: containers.vger.kernel.org On Wed 31-10-12 09:41:23, Tejun Heo wrote: > Hey, Michal. > > On Wed, Oct 31, 2012 at 03:37:51PM +0100, Michal Hocko wrote: > > > + for_each_subsys(cgrp->root, ss) > > > + if (ss->pre_destroy) > > > + WARN_ON_ONCE(ss->pre_destroy(cgrp)); > > > > Hmm, I am not sure I like this WARN_ON_ONCE. First it can happen for > > more than one controller and second we can just clear CGRP_WAIT_ON_RMDIR > > and return with EBUSY. The only possible failure at the moment is when a > > new task or a child group appear. > > I know it is not a big deal because it will disappear later in the > > series but it would be more readable IMO. > > The WARN_ON_ONCE() is just moved from the original > cgroup_call_pre_destroy(). We can add an error out there but that > makes future changes difficult. It's a chicken and egg problem. You > gotta break the loop somewhere. I do not think this is that hard. You can simply change the return path on pre_destroy error by BUG_ON in "cgroup: deactivate CSS's and mark cgroup dead before invoking ->pre_destroy()". There is no chicke&egg problem here because once the group is marked dead and css frozen then the existing callbacks cannot possibly fail. Or am I missing your point? -- Michal Hocko SUSE Labs