From: Tejun Heo Subject: Re: [PATCH 3/8] cgroup: use cgroup_lock_live_group(parent) in cgroup_create() Date: Thu, 1 Nov 2012 08:43:20 -0700 Message-ID: <20121101154320.GA8712@htj.dyndns.org> References: <1351657365-25055-1-git-send-email-tj@kernel.org> <1351657365-25055-4-git-send-email-tj@kernel.org> <20121031155514.GD22809@dhcp22.suse.cz> <20121031170431.GF2945@htj.dyndns.org> <20121101091644.GA8533@dhcp22.suse.cz> <20121101150532.GA5065@dhcp22.suse.cz> <20121101151556.GB5065@dhcp22.suse.cz> 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:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=YxwhEESIEFybzJPt+xtsRL+ev45nQbZwivrTavJxs40=; b=BZmmTuBZnUZL7rc+xZXW7pmouhtXG/cn3X+2VpIIEOO0VO8w8RFMOEiecByI1oIqA1 0A5mUA9wHblevI7OAlrGrVx+mVz3NKAwYsmvT+Jx2XCBcSFEtPmxl+yMjb0gDt5hwAQQ E1cdCB9URqTLfvksEQsJjgIBHwsec3BQuJx4f9zdmRtK56gdsoeGTmXZTwui6W8ebRSr TCoSJ1xGSnQv/k3WepyHCpaCZBIcE/D2NphOfcfKNqg/T9k+Ry/M+9AnIlE0Iz8U5Gz7 MOKTi56I3tuzBSZhu4NvnKON170u/11NLnVl7Cp/bmnKO6xx4uUxbUmWC9mFl3kYZ7H3 qSfA== Content-Disposition: inline In-Reply-To: <20121101151556.GB5065-2MMpYkNvuYDjFM9bn6wA6Q@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 To: Michal Hocko Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Hey, Michal. On Thu, Nov 01, 2012 at 04:15:56PM +0100, Michal Hocko wrote: > > if (!cgroup_lock_live_group(parent)) > > return -ENODEV; > > > > cgrp = kzalloc(sizeof(*cgrp), GFP_KERNEL); > > if (!cgrp) > > return -ENOMEM; > > this needs to drop the lock of course but it doesn't make it much more > complicated... Yeah, now look at the error exit path of the function. You have to reorder them too so that it matches the changed order above, which is all fine and dandy, but one way is not necessarily better than the other, so there's no good reason to incur that churn. Thanks. -- tejun