From: David Rientjes <rientjes@google.com>
To: Lubos Lunak <l.lunak@suse.cz>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>,
Rik van Riel <riel@redhat.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
Nick Piggin <npiggin@suse.de>, Jiri Kosina <jkosina@suse.cz>
Subject: Re: Improving OOM killer
Date: Thu, 11 Feb 2010 13:17:29 -0800 (PST) [thread overview]
Message-ID: <alpine.DEB.2.00.1002111303570.1461@chino.kir.corp.google.com> (raw)
In-Reply-To: <201002111116.07211.l.lunak@suse.cz>
On Thu, 11 Feb 2010, Lubos Lunak wrote:
> I believe that with the algorithm no longer using VmSize and being careful
> not to count shared memory more than once this would not be an issue and
> kdeinit would be reasonably safe. KDE does not use _that_ much memory to
> score higher than something that caused OOM :).
>
Your suggestion of summing up the memory of the parent and its children
would clearly bias kdeinit if it forks most of kde's threads as you
mentioned earlier in the thread. Imagine it, or another server
application that Rik mentioned, if all children are first generation: then
it would always be selected if that it is the only task operating on the
system. For a web server, for instance, where each query is handled by a
seperate thread, we'd obviously prefer to kill a child thread instead of
making the entire server unresponsive. That type of algorithm in the oom
killer and to kill the parent instead is just a non-starter.
> Our definitions of 'forkbomb' then perhaps differ a bit. I
> consider 'make -j100' a kind of a forkbomb too, it will very likely overload
> the machine too as soon as the gcc instances use up all the memory. For that
> reason also using CPU time <1second will not work here, while using real time
> <1minute would.
>
1 minute? Unless you've got one of SGI's 4K cpu machines where these 1000
threads would actually get any runtime _at_all_ in such circumstances,
that threshold is unreasonable.
A valid point that wasn't raised is although we can't always detect out of
control forking applications, we certainly should do some due diligence in
making sure other applications aren't unfairly penalized when you do
make -j100, for example. That's not the job of the forkbomb detector in
my heuristic, however, it's the job of the baseline itself. In such
scenarios (and when we can't allocate or free any memory), the baseline is
responsible for identifying these tasks and killing them itself because
they are using an excessive amount of memory.
> Your protection seems to cover only "for(;;) if(fork() == 0) break;" , while
> I believe mine could handle also "make -j100" or the bash forkbomb ":()
> { :|:& };:" (i.e. "for(;;) fork();").
>
Again, it's not protection against forkbombs: the oom killer is not the
place where you want to enforce any policy that prohibits that.
> Why? It repeatedly causes OOM here (and in fact it is the only common OOM or
> forkbomb I ever encounter). If OOM killer is the right place to protect
> against a forkbomb that spawns a large number of 1st level children, then I
> don't see how this is different.
>
We're not protecting against a large number of first-generation children,
we're simply penalizing them because the oom killer chooses to kill a
large memory-hogging task instead of the parent first. This shouldn't be
described as "forkbomb detection" because thats outside the scope of the
oom killer or VM, for that matter.
--
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:[~2010-02-11 21:17 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-01 22:02 Lubos Lunak
2010-02-01 23:53 ` David Rientjes
2010-02-02 21:10 ` Lubos Lunak
2010-02-03 1:41 ` David Rientjes
2010-02-03 1:52 ` KAMEZAWA Hiroyuki
2010-02-03 2:12 ` David Rientjes
2010-02-03 2:12 ` KAMEZAWA Hiroyuki
2010-02-03 2:36 ` [patch] sysctl: clean up vm related variable declarations David Rientjes
2010-02-03 8:07 ` KOSAKI Motohiro
2010-02-03 8:17 ` Balbir Singh
2010-02-03 22:54 ` Improving OOM killer Lubos Lunak
2010-02-04 0:00 ` David Rientjes
2010-02-03 7:50 ` KOSAKI Motohiro
2010-02-03 9:40 ` David Rientjes
2010-02-03 8:57 ` Balbir Singh
2010-02-03 12:10 ` Lubos Lunak
2010-02-03 12:25 ` Balbir Singh
2010-02-03 15:00 ` Minchan Kim
2010-02-03 16:06 ` Minchan Kim
2010-02-03 21:22 ` Lubos Lunak
2010-02-03 14:49 ` Rik van Riel
2010-02-03 17:01 ` Balbir Singh
2010-02-03 18:58 ` David Rientjes
2010-02-03 19:29 ` Frans Pop
2010-02-03 19:52 ` David Rientjes
2010-02-03 20:12 ` Frans Pop
2010-02-03 20:26 ` David Rientjes
2010-02-03 22:55 ` Lubos Lunak
2010-02-04 0:05 ` David Rientjes
2010-02-04 0:18 ` Rik van Riel
2010-02-04 21:48 ` David Rientjes
2010-02-04 22:06 ` Rik van Riel
2010-02-04 22:14 ` David Rientjes
2010-02-10 20:54 ` Lubos Lunak
2010-02-10 21:10 ` Rik van Riel
2010-02-10 21:29 ` Lubos Lunak
2010-02-10 22:18 ` Alan Cox
2010-02-10 22:31 ` David Rientjes
2010-02-11 9:50 ` Lubos Lunak
2010-02-04 22:31 ` Frans Pop
2010-02-04 22:53 ` David Rientjes
2010-02-04 7:58 ` Lubos Lunak
2010-02-04 21:34 ` David Rientjes
2010-02-10 20:54 ` Lubos Lunak
2010-02-10 21:09 ` Rik van Riel
2010-02-10 21:34 ` Lubos Lunak
2010-02-10 22:25 ` David Rientjes
2010-02-11 10:16 ` Lubos Lunak
2010-02-11 21:17 ` David Rientjes [this message]
2010-02-04 9:50 ` Jiri Kosina
2010-02-04 21:39 ` David Rientjes
2010-02-05 7:35 ` Oliver Neukum
2010-02-10 3:10 ` David Rientjes
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.1002111303570.1461@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=jkosina@suse.cz \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=l.lunak@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=npiggin@suse.de \
--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