From mboxrd@z Thu Jan 1 00:00:00 1970 From: Li Zefan Subject: Re: [PATCH 1/3] cgroup: simplify double-check locking in cgroup_attach_proc Date: Thu, 05 Jan 2012 10:08:15 +0800 Message-ID: <4F05060F.5090600@cn.fujitsu.com> References: <1325654312-32477-1-git-send-email-msb@chromium.org> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1325654312-32477-1-git-send-email-msb-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Mandeep Singh Baines Cc: Tejun Heo , Frederic Weisbecker , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, KAMEZAWA Hiroyuki , Oleg Nesterov , Andrew Morton , Paul Menage Mandeep Singh Baines wrote: > To keep the complexity of the double-check locking in one place, > I moved the thread_group_leader check up into attach_task_by_pid. > This allows us to use a goto instead of returning -EAGAIN. > > While at it, converted a couple of returns to gotos and used > rcu for the !pid case also in order to simplify the logic. > > Changes in V2: > * https://lkml.org/lkml/2011/12/22/86 (Tejun Heo) > * Use a goto instead of returning -EAGAIN > > Signed-off-by: Mandeep Singh Baines Acked-by: Li Zefan > Cc: Tejun Heo > Cc: Li Zefan > Cc: Frederic Weisbecker > Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org > Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > Cc: KAMEZAWA Hiroyuki > Cc: Oleg Nesterov > Cc: Andrew Morton > Cc: Paul Menage > --- > kernel/cgroup.c | 79 ++++++++++++++++++++---------------------------------- > 1 files changed, 29 insertions(+), 50 deletions(-)