From: David Rientjes <rientjes@google.com>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Rik van Riel <riel@redhat.com>, Paul Menage <menage@google.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [patch -mm v2] mm: introduce oom_adj_child
Date: Thu, 30 Jul 2009 00:06:38 -0700 (PDT) [thread overview]
Message-ID: <alpine.DEB.2.00.0907292356410.5581@chino.kir.corp.google.com> (raw)
In-Reply-To: <20090730090855.E415.A69D9226@jp.fujitsu.com>
On Thu, 30 Jul 2009, KOSAKI Motohiro wrote:
> > diff --git a/kernel/fork.c b/kernel/fork.c
> > --- a/kernel/fork.c
> > +++ b/kernel/fork.c
> > @@ -426,7 +426,7 @@ static struct mm_struct * mm_init(struct mm_struct * mm, struct task_struct *p)
> > init_rwsem(&mm->mmap_sem);
> > INIT_LIST_HEAD(&mm->mmlist);
> > mm->flags = (current->mm) ? current->mm->flags : default_dump_filter;
> > - mm->oom_adj = (current->mm) ? current->mm->oom_adj : 0;
> > + mm->oom_adj = p->oom_adj_child;
>
> This code doesn't fix anything.
> mm->oom_adj assignment still change vfork() parent process oom_adj value.
> (Again, vfork() parent and child use the same mm)
>
That's because the oom killer only really considers the highest oom_adj
value amongst all threads that share the same mm. Allowing those threads
to each have different oom_adj values leads (i) to an inconsistency in
reporting /proc/pid/oom_score for how the oom killer selects a task to
kill and (ii) the oom killer livelock that it fixes when one thread
happens to be OOM_DISABLE.
So, yes, changing the oom_adj value for a thread may have side-effects
on other threads that didn't exist prior to 2.6.31-rc1 because the oom_adj
value now represents a killable quantity of memory instead of a being a
characteristic of the task itself. But we now provide the inheritance
property in a new way, via /proc/pid/oom_adj_child, that gives you all the
functionality that the previous way did but without the potential for
livelock.
> IOW, in vfork case, oom_adj_child parameter doesn't only change child oom_adj,
> but also parent oom_adj value.
Changing oom_adj_child for a task never changes oom_adj for any mm, it
simply specifies what default value shall be given for a child's newly
initialized mm. Chaning oom_adj, on the other hand, will
> IOW, oom_adj_child is NOT child effective parameter.
>
It's not meant to be, it's only meant to specify a default value for newly
initialized mm's of its descendants. What happens after that is governed
completely by the child's own /proc/pid/oom_adj. That's pretty clearly
explained in Documentation/filesystems/proc.txt.
--
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:[~2009-07-30 7:06 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-29 4:27 David Rientjes
2009-07-29 23:13 ` Andrew Morton
2009-07-29 23:25 ` Paul Menage
2009-07-30 2:32 ` KOSAKI Motohiro
2009-07-30 7:06 ` David Rientjes [this message]
2009-07-31 6:47 ` KOSAKI Motohiro
2009-07-31 9:31 ` David Rientjes
2009-08-03 11:58 ` KOSAKI Motohiro
2009-08-03 12:12 ` KOSAKI Motohiro
2009-07-30 9:00 ` KAMEZAWA Hiroyuki
2009-07-30 9:31 ` David Rientjes
2009-07-30 10:02 ` KAMEZAWA Hiroyuki
2009-07-30 19:05 ` David Rientjes
2009-07-31 0:33 ` KAMEZAWA Hiroyuki
2009-07-31 6:50 ` KOSAKI Motohiro
2009-07-31 19:38 ` David Rientjes
2009-08-03 12:16 ` KOSAKI Motohiro
2009-07-31 9:36 ` David Rientjes
2009-07-31 10:49 ` KAMEZAWA Hiroyuki
2009-07-31 19:18 ` David Rientjes
2009-08-01 1:10 ` KAMEZAWA Hiroyuki
2009-08-01 20:26 ` David Rientjes
2009-08-03 1:42 ` KAMEZAWA Hiroyuki
2009-08-03 7:59 ` David Rientjes
2009-08-03 8:02 ` KAMEZAWA Hiroyuki
2009-08-03 8:08 ` David Rientjes
2009-08-03 8:45 ` KAMEZAWA Hiroyuki
2009-08-03 8:55 ` KAMEZAWA Hiroyuki
2009-08-03 12:19 ` KOSAKI Motohiro
2009-08-03 12:32 ` KOSAKI Motohiro
2009-08-03 12:21 ` KOSAKI Motohiro
2009-08-03 16:17 ` 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=alpine.DEB.2.00.0907292356410.5581@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=akpm@linux-foundation.org \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=menage@google.com \
--cc=riel@redhat.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