From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: balbir@linux.vnet.ibm.com
Cc: Paul Menage <menage@google.com>,
Pavel Emelianov <xemul@openvz.org>,
Hugh Dickins <hugh@veritas.com>,
Sudhir Kumar <skumar@linux.vnet.ibm.com>,
YAMAMOTO Takashi <yamamoto@valinux.co.jp>,
linux-kernel@vger.kernel.org, taka@valinux.co.jp,
linux-mm@kvack.org, David Rientjes <rientjes@google.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [-mm] Add an owner to the mm_struct (v9)
Date: Fri, 11 Apr 2008 13:47:39 +0900 [thread overview]
Message-ID: <20080411134739.1aae8bae.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <47FEE89A.1010102@linux.vnet.ibm.com>
On Fri, 11 Apr 2008 09:57:06 +0530
Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
> KAMEZAWA Hiroyuki wrote:
> > maybe I don't undestand correctlly...
> >
> > On Thu, 10 Apr 2008 14:46:02 +0530
> > Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
> >
> >>
> >> +config MM_OWNER
> >> + bool
> >> +
> > no default is ok here ? what value will this have if not selected ?
> > I'm sorry if I misunderstand Kconfig.
> >
>
> The way this works is
>
> If I select memory resource controller, CONFIG_MM_OWNER is set to y, else it
> does not even show up in the .config
>
ok, sorry for noise.
> >
> >> + /*
> >> + * Search through everything else. We should not get
> >> + * here often
> >> + */
> >> + do_each_thread(g, c) {
> >> + if (c->mm == mm)
> >> + goto assign_new_owner;
> >> + } while_each_thread(g, c);
> >> +
> >
> > Again, do_each_thread() is suitable here ?
> > for_each_process() ?
> >
>
> do_each_thread(), while_each_thread() walks all processes and threads of those
> processes in the system. It is a common pattern used in the kernel (see
> try_to_freeze_tasks() or oom_kill_task() for example).
>
What you want is finding a thread which has the "mm_struct". Why search all
threads ? I think you only have to search processes(i.e. thread-group-leaders).
try_to_freeze_tasks()/oom_kill_task() have to chase all threads because
it have to check flags in task_structs in a process.
Thanks,
-Kame
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2008-04-11 4:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-10 9:16 Balbir Singh
2008-04-11 3:33 ` KAMEZAWA Hiroyuki
2008-04-11 4:27 ` Balbir Singh
2008-04-11 4:47 ` KAMEZAWA Hiroyuki [this message]
2008-04-11 4:47 ` Balbir Singh
2008-04-11 4:58 ` KAMEZAWA Hiroyuki
2008-04-11 4:56 ` Balbir Singh
2008-04-15 1:31 ` KAMEZAWA Hiroyuki
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=20080411134739.1aae8bae.kamezawa.hiroyu@jp.fujitsu.com \
--to=kamezawa.hiroyu@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=menage@google.com \
--cc=rientjes@google.com \
--cc=skumar@linux.vnet.ibm.com \
--cc=taka@valinux.co.jp \
--cc=xemul@openvz.org \
--cc=yamamoto@valinux.co.jp \
/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