From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleg Nesterov Subject: Re: cgroup attach task - slogging cpu Date: Thu, 10 Oct 2013 13:11:10 +0200 Message-ID: <20131010111110.GB22827@redhat.com> References: <20131004130207.GA9338@redhat.com> <20131007184507.GD27396@htj.dyndns.org> <20131008145833.GA15600@redhat.com> <5254EB2A.7090803@huawei.com> <20131009133047.GA12414@redhat.com> <20131009140551.GA15849@redhat.com> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Anjana V Kumar Cc: Li Zefan , Tejun Heo , anjana vk , cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Hi Anjana, > On 10/10, Anjana V Kumar wrote: > > > > > Problem: > Issue when attaching a single thread to a cgroup if the thread was alredy in the > cgroup. The check if the thread is already in cgroup in the above case, > continues to the next thread instead of exciting. Yes. Thanks. > @@ -2047,7 +2047,7 @@ static int cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk, > ent.cgrp = task_cgroup_from_root(tsk, root); > /* nothing to do if this task is already in the cgroup */ > if (ent.cgrp == cgrp) > - continue; > + goto next_thread; > /* > * saying GFP_ATOMIC has no effect here because we did prealloc > * earlier, but it's good form to communicate our expectations. > @@ -2055,7 +2055,7 @@ static int cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk, > retval = flex_array_put(group, i, &ent, GFP_ATOMIC); > BUG_ON(retval != 0); > i++; > - > +next_thread: Yes, but you forgot to fix another "continue" after "ent.cgrp == cgrp" ;) Oleg.