From: David Rientjes <rientjes@google.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Rik van Riel <riel@redhat.com>, Paul Menage <menage@google.com>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [patch -mm v2] mm: introduce oom_adj_child
Date: Mon, 3 Aug 2009 00:59:18 -0700 (PDT) [thread overview]
Message-ID: <alpine.DEB.2.00.0908030050160.30778@chino.kir.corp.google.com> (raw)
In-Reply-To: <20090803104244.b58220ba.kamezawa.hiroyu@jp.fujitsu.com>
On Mon, 3 Aug 2009, KAMEZAWA Hiroyuki wrote:
> > - /proc/pid/oom_score is inconsistent when tuning /proc/pid/oom_adj if it
> > relies on the per-thread oom_adj; it now really represents nothing but
> > an incorrect value if other threads share that memory and misleads the
> > user on how the oom killer chooses victims, or
>
> What's why I said to show effective_oom_adj if necessary..
>
Right, but which of the following two behaviors do you believe the
majority of today's user applications are written to use?
(1) /proc/pid/oom_score represents the badness heuristic that the oom
killer uses to determine which task to kill, or
(2) /proc/pid/oom_adj can be adjusted after vfork() and prior to exec()
to represent the oom preference of the child without simultaneously
changing the oom preference of the parent.
The two are at a complete contrast and cannot co-exist. I favor behavior
(1), which is why my patches make it consistent in _all_ cases, since it
is more likely than not that the majority of user applications use that
behavior if, for no other reason, than it is the DOCUMENTED reason.
If you feel that's an unreasonable conclusion, then please say that so
your argument can be judged based on your interpretation of that behavior
which I believe most others would disagree with. Otherwise, our
discussion will continue to go in circles.
> > - /proc/pid/oom_score is inconsistent when the thread that set the
> > effective per-mm oom_adj exits and it is now obsolete since you have
> > no way to determine what the next effective oom_adj value shall be.
> >
> plz re-caluculate it. it's not a big job if done in lazy way.
>
You can't recalculate it if all the remaining threads have a different
oom_adj value than the effective oom_adj value from the thread that is now
exited. There is no assumption that, for instance, the most negative
oom_adj value shall then be used. Imagine the effective oom_adj value
being +15 and a thread sharing the same memory has an oom_adj value of
-16. Under no reasonable circumstance should the oom preference of the
entire thread then change to -16 just because its the side-effect of a
thread exiting.
That's the _entire_ reason why we need consistency in oom_adj values so
that userspace is aware of how the oom killer really works and chooses
tasks. I understand that it differs from the previously allowed behavior,
but those userspace applications need to be fixed if, for no other reason,
they are now consistent with how the oom killer kills tasks. I think
that's a very worthwhile goal and the cost of moving to a new interface
such as /proc/pid/oom_adj_child to have the same inheritance property that
was available in the past is justified.
--
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-08-03 7:41 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
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 [this message]
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.0908030050160.30778@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=akpm@linux-foundation.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--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