From: Balbir Singh <balbir-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
To: KAMEZAWA Hiroyuki
<kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
Cc: "menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org"
<menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
fernando-gVGce1chcLdL9jVzuh4AOg@public.gmane.org,
containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
virtualization-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Subject: Re: RFC: Attaching threads to cgroups is OK?
Date: Tue, 19 Aug 2008 17:57:29 +0530 [thread overview]
Message-ID: <48AABC31.7070207@linux.vnet.ibm.com> (raw)
In-Reply-To: <20080819202237.edd75933.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
KAMEZAWA Hiroyuki wrote:
> On Tue, 19 Aug 2008 19:38:14 +0900
> Takuya Yoshikawa <yoshikawa.takuya-gVGce1chcLdL9jVzuh4AOg@public.gmane.org> wrote:
>
>> Hi everyone,
>>
>> I have a question about cgroup's policy concerning the treatment of
>> threads. Please consider that we want to attach an application which has
>> some threads already to a certain cgroup. If we echo the pid of this
>> application to the "tasks" file connected to this cgroup the threads
>> belonging to this application will NOT be moved to the new group. Is it
>> right? If so, is it OK?
>>
> Added Paul and Balbir to CC:.
>
> I think it is OK ...means it works as designed
> (now, see below about future.)
>
>> I mean, in the current implementation, threads created before the
>> attachement of the parent process are not treated eaqually to those
>> created after.
>>
>> Could you tell me if you know something about the rules of attachement
>> of pid, or tid, to cgroups? -- what ID is OK to write to "tasks" file
>> and what we can expect as a result?
>>
>
> Any PID is ok for "tasks". IIRC, Paul proposed "procs" file, which support
> moving all threads of the same PIDs.
> This mail from Paul explains some : http://lwn.net/Articles/289930/
>
Yes, this was also discussed at the containers mini-summit
Please see
http://groups.google.com/group/fa.linux.kernel/browse_thread/thread/ccb5e818209af143
>
>> Tsuruta-san, how about your bio-cgroup's tracking concerning this?
>> If we want to use your tracking functions for each threads seperately,
>> there seems to be a problem.
>> ===cf. mm_get_bio_cgroup()===================
>> owner
>> mm_struct ----> task_struct ----> bio_cgroup
>> =============================================
>> In my understanding, the mm_struct of a thread is same as its parent's.
>> So, even if we attach the TIDs of some threads to different cgroups the
>> tracking always returns the same bio_cgroup -- its parent's group.
>> Do you have some policy about in which case we can use your tracking?
>>
> It's will be resitriction when io-controller reuse information of the owner
> of memory. But if it's very clear who issues I/O (by tracking read/write
> syscall), we may have chance to record the issuer of I/O to page_cgroup
> struct.
We already do some tracking (at dirty time, IIRC) for task IO accounting. For
the memory controller, tasks are virtually grouped by the mm_struct.
--
Balbir
next prev parent reply other threads:[~2008-08-19 12:27 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-19 10:38 RFC: Attaching threads to cgroups is OK? Takuya Yoshikawa
[not found] ` <48AAA296.8050802-gVGce1chcLdL9jVzuh4AOg@public.gmane.org>
2008-08-19 11:22 ` KAMEZAWA Hiroyuki
[not found] ` <20080819202237.edd75933.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2008-08-19 12:27 ` Balbir Singh [this message]
[not found] ` <48AABC31.7070207-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2008-08-19 12:52 ` Fernando Luis Vázquez Cao
[not found] ` <1219150334.14590.12.camel-xpvPi5bcW5X5OjGIXfuPlhrrLbDL3r4M6qtp775pBPw@public.gmane.org>
2008-08-20 7:12 ` Hirokazu Takahashi
[not found] ` <20080820.161247.64324924.taka-jCdQPDEk3idL9jVzuh4AOg@public.gmane.org>
2008-08-20 8:43 ` KAMEZAWA Hiroyuki
[not found] ` <20080820174334.a566a775.kamezawa.hiroyu@jp.fujitsu.com>
[not found] ` <20080820174334.a566a775.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2008-08-22 1:03 ` Takuya Yoshikawa
2008-08-20 5:52 ` Takuya Yoshikawa
2008-08-20 11:48 ` Hirokazu Takahashi
[not found] ` <20080820.204832.131207708.taka-jCdQPDEk3idL9jVzuh4AOg@public.gmane.org>
2008-08-21 3:08 ` Fernando Luis Vázquez Cao
[not found] ` <1219288081.28324.30.camel-xpvPi5bcW5X5OjGIXfuPlhrrLbDL3r4M6qtp775pBPw@public.gmane.org>
2008-08-21 3:32 ` Balbir Singh
[not found] ` <48ACE1B4.8010000-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2008-08-21 5:25 ` Fernando Luis Vázquez Cao
[not found] ` <1219296306.28324.82.camel-xpvPi5bcW5X5OjGIXfuPlhrrLbDL3r4M6qtp775pBPw@public.gmane.org>
2008-08-21 10:28 ` Balbir Singh
2008-08-22 18:55 ` Vivek Goyal
[not found] ` <1219660569.16371.161.camel@sebastian.kern.oss.ntt.co.jp>
[not found] ` <1219660569.16371.161.camel-xpvPi5bcW5X5OjGIXfuPlhrrLbDL3r4M6qtp775pBPw@public.gmane.org>
2008-09-05 11:50 ` Hirokazu Takahashi
[not found] ` <20080905.205016.28412219.taka-jCdQPDEk3idL9jVzuh4AOg@public.gmane.org>
2008-09-05 12:00 ` Hirokazu Takahashi
[not found] ` <20080905.210017.44596963.taka-jCdQPDEk3idL9jVzuh4AOg@public.gmane.org>
2008-09-05 15:38 ` Vivek Goyal
[not found] ` <20080905153832.GE13742@redhat.com>
[not found] ` <20080905153832.GE13742-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2008-09-08 2:58 ` Takuya Yoshikawa
[not found] ` <48C494EB.4080502-gVGce1chcLdL9jVzuh4AOg@public.gmane.org>
2008-09-08 11:52 ` Hirokazu Takahashi
2008-09-08 12:47 ` Hirokazu Takahashi
[not found] ` <20080822185527.GD27964-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2008-08-25 10:36 ` Fernando Luis Vázquez Cao
2008-09-12 18:57 ` Vivek Goyal
2008-08-20 7:41 ` Hirokazu Takahashi
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=48AABC31.7070207@linux.vnet.ibm.com \
--to=balbir-23vcf4htsmix0ybbhkvfkdbpr1lh4cv8@public.gmane.org \
--cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=fernando-gVGce1chcLdL9jVzuh4AOg@public.gmane.org \
--cc=kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org \
--cc=menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=virtualization-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox