From: "Balbir Singh" <balbir@linux.vnet.ibm.com>
To: "Evgeniy Polyakov" <zbr@ioremap.net>
Cc: "Alan Cox" <alan@lxorguk.ukuu.org.uk>,
"Dave Jones" <davej@redhat.com>,
linux-kernel@vger.kernel.org,
"Andrew Morton" <akpm@linux-foundation.org>,
"Linus Torvalds" <torvalds@linux-foundation.org>
Subject: Re: [why oom_adj does not work] Re: Linux killed Kenny, bastard!
Date: Tue, 13 Jan 2009 20:30:16 +0530 [thread overview]
Message-ID: <661de9470901130700m34c4938cm6feeb6fc561d605a@mail.gmail.com> (raw)
In-Reply-To: <20090113142423.GA30710@ioremap.net>
On Tue, Jan 13, 2009 at 7:54 PM, Evgeniy Polyakov <zbr@ioremap.net> wrote:
> On Tue, Jan 13, 2009 at 02:06:27PM +0000, Alan Cox (alan@lxorguk.ukuu.org.uk) wrote:
>> > Do you _REALLY_ think anyone can calculate it yourself and then properly
>> > calculate adjustment used to properly select oom-killed process?
>>
>> Its always a heuristic.
>
> For the system which knows what it is. User does not and really can not
> work with it, since there is no sane way to implement that heuristic in
> the applications or even in (theoretically possible) monitor daemon.
>
> So, effectively, oom adjustment does not work.
>
>> > So far my patch is the sanest way to deal with the OOM selection
>>
>> No. You keep maintaining this but your crude hack is useless in a non
>> co-operative environment, has lots of issue with name aliasing and
>> doesn't deal with real needs.
>
> It is created because of real needs. Because people need to control the
> behaviour of the system and they want to control which application will
> be killed to free the memory. Attached patch is not the best solution,
> but it works for the all cases I can think about.
>
Where does this end? Tomorrow you'll add an interface for applications
that should *not* be killed? What sort of a heuristic is name? I think
the only name the kernel knows about is "init".
> Let's take you 'name aliasing' claim: if there are several processes
> with the same name, system will select the one with the worst score
> according to the own magical algorithm. So it will not kill random
> process just because it happend to have ricky name.
>
Having a name in the kernel is like building a hit-list, why can't the
examples that Alan sent work for you?
Names are tricky as well, if someone used a symbolic link to the
application with a different name, they would no longer be candidates
for OOM first? or vice-versa?
> And the same applies to the other issues. It just helps system to select
> the process to be killed according to userspace expectation of what
> should be killed to free the memory.
>
>> We have container interfaces that can do this and far more and do them
>> right. In fact the very start of all the OpenVZ and container work years
>> ago was the beancounter patches which were addressed at exactly this
>> problem (although more specifically 'making sure undergraduates processes
>> get killed first')
>
> Are the beancounters used to limit amount of virtual ram and not the
> physical one? It really does not work to limit for example some java
> machine which will ate all virtual space swapping out different node.
> It works for some (and likely the most, I do not argue this) cases and
> has overhead. But we are talking not about how to limit the processes,
> but what to do when we happend to have out-of-memory condition. And it
> happens all the time even if you put the processes into the separate
> container, since there are situations (that's why it was started at
> first), when you have a huge process which should not be killed and set
> of either its children or external processes, which should be checked
> and some of them (administrator would like to specify the less
> important) should be killed without much harm to the system.
>
> And patch I presented allows to do it. It introduces a hint for the
> killer on what processes should be checked first. It works exactly the
> way people work with their system: they run different application and
> expect some of them to be higher or lower priority when things come to
> the oom condition. No one ever proposes to kill exactly the process we
> select (although that may be a good idea in some cases), but instead to
> show that oom-killer should check given group first. The group
> administrator knows to be potentially harmless.
>
You can replace the lines of kernel code you wrote with a simple
one-line script that Alan sent out.
Balbir
next prev parent reply other threads:[~2009-01-13 15:00 UTC|newest]
Thread overview: 83+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-12 15:33 Evgeniy Polyakov
2009-01-12 15:44 ` Dave Jones
2009-01-12 15:48 ` Evgeniy Polyakov
2009-01-12 15:51 ` Alan Cox
2009-01-12 15:52 ` Evgeniy Polyakov
2009-01-12 21:29 ` Chris Snook
2009-01-12 21:42 ` Evgeniy Polyakov
2009-01-13 13:52 ` [why oom_adj does not work] " Evgeniy Polyakov
2009-01-13 14:06 ` Alan Cox
2009-01-13 14:24 ` Evgeniy Polyakov
2009-01-13 15:00 ` Balbir Singh [this message]
2009-01-13 15:21 ` Evgeniy Polyakov
2009-01-13 18:04 ` Valdis.Kletnieks
2009-01-13 19:46 ` David Rientjes
2009-01-13 21:33 ` Evgeniy Polyakov
2009-01-13 21:39 ` David Rientjes
2009-01-13 22:05 ` Evgeniy Polyakov
2009-01-14 16:12 ` OOM documentation update [was: Linux killed Kenny, bastard!] Evgeniy Polyakov
2009-01-14 17:06 ` [take2] " Evgeniy Polyakov
2009-01-14 21:34 ` Randy Dunlap
2009-01-14 21:53 ` Bryan Donlan
2009-01-14 22:10 ` Evgeniy Polyakov
2009-01-14 22:14 ` [take3] " Evgeniy Polyakov
2009-01-15 0:58 ` David Rientjes
2009-01-15 8:51 ` Evgeniy Polyakov
2009-01-15 8:57 ` [take4] " Evgeniy Polyakov
2009-01-15 11:13 ` David Rientjes
2009-01-12 15:49 ` Linux killed Kenny, bastard! Alan Cox
2009-01-12 15:50 ` Evgeniy Polyakov
2009-01-12 15:52 ` Alan Cox
2009-01-12 15:56 ` Evgeniy Polyakov
2009-01-12 16:19 ` Alan Cox
2009-01-12 16:29 ` Evgeniy Polyakov
2009-01-12 23:00 ` Bill Davidsen
2009-01-12 23:17 ` Evgeniy Polyakov
2009-01-13 1:53 ` David Rientjes
2009-01-13 8:52 ` Evgeniy Polyakov
2009-01-13 9:54 ` David Rientjes
2009-01-13 11:54 ` Evgeniy Polyakov
2009-01-13 12:15 ` Alan Cox
2009-01-13 12:29 ` Evgeniy Polyakov
2009-01-13 13:19 ` Theodore Tso
2009-01-13 13:35 ` Evgeniy Polyakov
2009-01-14 0:24 ` Bill Davidsen
2009-01-14 0:35 ` Evgeniy Polyakov
2009-01-13 13:47 ` Alan Cox
2009-01-13 19:36 ` David Rientjes
2009-01-13 21:46 ` Evgeniy Polyakov
2009-01-13 22:49 ` Theodore Tso
2009-01-13 23:02 ` Evgeniy Polyakov
2009-01-14 1:11 ` Theodore Tso
2009-01-14 1:20 ` Evgeniy Polyakov
2009-01-14 4:06 ` Theodore Tso
2009-01-13 23:10 ` David Rientjes
2009-01-13 23:35 ` Evgeniy Polyakov
2009-01-13 23:43 ` David Rientjes
2009-01-13 23:55 ` Evgeniy Polyakov
2009-01-14 0:32 ` David Rientjes
2009-01-14 0:53 ` Evgeniy Polyakov
2009-01-14 4:23 ` Valdis.Kletnieks
2009-01-14 9:07 ` Evgeniy Polyakov
2009-01-13 19:15 ` David Rientjes
2009-01-13 22:00 ` Evgeniy Polyakov
2009-01-13 23:26 ` Valdis.Kletnieks
2009-01-13 23:36 ` Evgeniy Polyakov
2009-01-13 13:41 ` Jan-Frode Myklebust
2009-01-13 13:59 ` Alan Cox
2009-01-12 16:22 ` Dave Jones
2009-01-12 16:28 ` Evgeniy Polyakov
2009-01-13 16:35 ` KOSAKI Motohiro
2009-01-13 22:04 ` Evgeniy Polyakov
[not found] <bTx3z-8bU-23@gated-at.bofh.it>
[not found] ` <bTxdg-8sZ-23@gated-at.bofh.it>
[not found] ` <bTxdg-8sZ-21@gated-at.bofh.it>
[not found] ` <bTxmW-hf-1@gated-at.bofh.it>
[not found] ` <bTRYr-2up-21@gated-at.bofh.it>
2009-01-14 19:18 ` [why oom_adj does not work] " Bodo Eggert
2009-01-14 19:22 ` Evgeniy Polyakov
2009-01-15 0:54 ` David Rientjes
2009-01-15 8:43 ` Evgeniy Polyakov
2009-01-15 21:50 ` Bodo Eggert
2009-01-15 22:35 ` Evgeniy Polyakov
2009-01-17 14:12 ` Bodo Eggert
2009-01-17 14:22 ` Evgeniy Polyakov
2009-01-18 12:37 ` Bodo Eggert
2009-01-18 13:13 ` Evgeniy Polyakov
2009-01-18 20:25 ` Bodo Eggert
2009-01-18 20:41 ` Evgeniy Polyakov
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=661de9470901130700m34c4938cm6feeb6fc561d605a@mail.gmail.com \
--to=balbir@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=davej@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=zbr@ioremap.net \
/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
all inboxes | Powered by JetHome®