All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Anjana V Kumar <anjanavk12-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>,
	Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	anjana vk <anjanvk12-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: cgroup attach task - slogging cpu
Date: Thu, 10 Oct 2013 13:11:10 +0200	[thread overview]
Message-ID: <20131010111110.GB22827@redhat.com> (raw)
In-Reply-To: <CAChhN7RerxpSadqyosUeSKFg+qcOpO4d-maEKBZ0rvOQGvN27g-JsoAwUIsXosN+BqQ9rBEUg@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.

      parent reply	other threads:[~2013-10-10 11:11 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-04  5:25 cgroup attach task - slogging cpu anjana vk
     [not found] ` <CALPf4Tz+Gf_Q7wKKBufCc1mtV1qVPVrOW0S1qhHxfOv6pJa2Kg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-10-04 13:02   ` Oleg Nesterov
     [not found]     ` <20131004130207.GA9338-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-10-07 18:45       ` Tejun Heo
     [not found]         ` <20131007184507.GD27396-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2013-10-08 14:58           ` Oleg Nesterov
     [not found]             ` <20131008145833.GA15600-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-10-09  5:35               ` Li Zefan
     [not found]                 ` <5254EB2A.7090803-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2013-10-09 13:30                   ` Oleg Nesterov
     [not found]                     ` <20131009133047.GA12414-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-10-09 14:05                       ` Oleg Nesterov
2013-10-09 16:54                         ` cgroup_attach_task && while_each_thread (Was: cgroup attach task - slogging cpu) Oleg Nesterov
2013-10-09 16:54                           ` Oleg Nesterov
2013-10-11 13:15                           ` Li Zefan
2013-10-11 13:15                             ` Li Zefan
2013-10-11 16:00                             ` Oleg Nesterov
2013-10-11 16:00                               ` Oleg Nesterov
2013-10-12  2:59                               ` [PATCH] cgroup: fix to break the while loop in cgroup_attach_task() correctly Li Zefan
2013-10-12  2:59                                 ` Li Zefan
2013-10-13 20:08                                 ` Tejun Heo
2013-10-13 20:08                                   ` Tejun Heo
2013-10-15  5:04                               ` cgroup_attach_task && while_each_thread (Was: cgroup attach task - slogging cpu) anjana vk
2013-10-15  5:04                                 ` anjana vk
2013-10-15 13:34                                 ` Tejun Heo
2013-10-15 13:34                                   ` Tejun Heo
     [not found]                         ` <CAChhN7RerxpSadqyosUeSKFg+qcOpO4d-maEKBZ0rvOQGvN27g@mail.gmail.com>
     [not found]                           ` <CAChhN7RerxpSadqyosUeSKFg+qcOpO4d-maEKBZ0rvOQGvN27g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-10-10  4:22                             ` cgroup attach task - slogging cpu anjana vk
2013-10-10 11:11                             ` Oleg Nesterov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131010111110.GB22827@redhat.com \
    --to=oleg-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=anjanavk12-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=anjanvk12-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.