From: Balbir Singh <balbir@linux.vnet.ibm.com>
To: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Paul Menage <menage@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
serue@us.ibm.com, penberg@cs.helsinki.fi,
linux-kernel@vger.kernel.org
Subject: Re: [Fwd: [-mm] Add an owner to the mm_struct (v9)]
Date: Thu, 17 Apr 2008 23:10:43 +0530 [thread overview]
Message-ID: <48078B9B.9070508@linux.vnet.ibm.com> (raw)
In-Reply-To: <20080417161936.GB4482@tv-sign.ru>
Hi, Oleg,
I've been slow in responding and I expect that situation to continue till the
weekend. I hope to respond to your queries sooner
Oleg Nesterov wrote:
> On 04/17, Paul Menage wrote:
>> On Thu, Apr 17, 2008 at 4:30 AM, Oleg Nesterov <oleg@tv-sign.ru> wrote:
>>> >
>>> > I had this loop earlier (inspired from zap_threads()), is this loop more
>>> > efficient than what we have?
>>>
>>> All sub-threads have the same ->mm. Once we see that c->mm != mm, we don't
>>> need to waste CPU iterating over the all other threads in the thread group.
>> Technically they don't have to have the same mm, right? You can use
>> CLONE_THREAD without CLONE_VM when creating a new subthread.
>
> No, no, this is not possible/allowed.
>
> Please look at copy_process, CLONE_THREAD requires CLONE_SIGHAND,
> CLONE_SIGHAND needs CLONE_VM.
>
What about the other way round, CLONE_VM without CLONE_THREAD?
>>> chance you have the "for dummies" explanation what mm->owner is?
>>> I mean, I can't understand how it is possible that 2 CLONE_VM tasks
>>> are not equal wrt "ownering".
>> The idea is to be able to get from an mm to a task, where that task is
>> representative of the tasks using the mm. Uses include:
>
> Thanks! but...
>
> Let's suppose 2 task belongs to different cgroups, but share ->mm,
>
>> - swap cgroup - when swapping from an mm, find a task whose swap
>> cgroup we can charge the swap page to
>
> now we will charge the somewhat "random" cgroup. The one to which
> the result of the last "find the next suitable owner" belongs.
>
Basically, with mm->owner and prior to that with the memory controller, we group
tasks by mm_struct instead of by task (virtually). Earlier, we had a hook in
mm_struct to tell us where the mm_struct belonged (to which cgroup). With
mm->owner, we can figure out where each subsystem belongs without having hooks
in mm_struct for each memory based controller subsystem.
When the owner exits (mm->owner), we pick the next owner and tell the tasks via
notification that the cgroup has changed (if it does). This does bring about
some issues, where without control accounting can move to a different cgroup all
of a sudden. To avoid that
We would recommend that the memory based controllers be mounted separately and
all related threads be put in the same cgroup
> This looks a bit strange to me... but OK, as I said, I don't know
> what cgroup is, please ignore me ;)
>
> Oleg.
>
Thanks for your review!
--
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL
next prev parent reply other threads:[~2008-04-17 17:43 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-14 14:13 [Fwd: [-mm] Add an owner to the mm_struct (v9)] Balbir Singh
2008-04-14 14:49 ` Pekka Enberg
2008-04-14 16:04 ` Paul Menage
2008-04-14 19:36 ` Andrew Morton
2008-04-14 21:06 ` Pekka Enberg
2008-04-15 0:07 ` Andrew Morton
2008-04-15 17:13 ` Oleg Nesterov
2008-04-15 18:13 ` Paul Menage
2008-04-15 19:59 ` Oleg Nesterov
2008-04-17 3:38 ` Balbir Singh
2008-04-17 11:30 ` Oleg Nesterov
2008-04-17 16:34 ` Paul Menage
2008-04-17 16:19 ` Oleg Nesterov
2008-04-17 17:40 ` Balbir Singh [this message]
2008-04-17 17:08 ` Oleg Nesterov
2008-04-17 17:50 ` Paul Menage
2008-04-17 19:07 ` Balbir Singh
2008-04-17 17:49 ` Paul Menage
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=48078B9B.9070508@linux.vnet.ibm.com \
--to=balbir@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=menage@google.com \
--cc=oleg@tv-sign.ru \
--cc=penberg@cs.helsinki.fi \
--cc=serue@us.ibm.com \
/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