From: Stephan von Krawczynski <skraw@ithnet.com>
To: Marcelo Tosatti <marcelo@conectiva.com.br>
Cc: torvalds@transmeta.com, andrea@suse.de, linux-kernel@vger.kernel.org
Subject: Re: out_of_memory() heuristic broken for different mem configurations
Date: Tue, 6 Nov 2001 15:21:36 +0100 [thread overview]
Message-ID: <20011106152136.3db4ee73.skraw@ithnet.com> (raw)
In-Reply-To: <Pine.LNX.4.21.0111061015190.9867-100000@freak.distro.conectiva>
In-Reply-To: <20011106143108.6ef304d5.skraw@ithnet.com> <Pine.LNX.4.21.0111061015190.9867-100000@freak.distro.conectiva>
On Tue, 6 Nov 2001 10:22:02 -0200 (BRST) Marcelo Tosatti
<marcelo@conectiva.com.br> wrote:
> > How about this really stupid idea: oom means allocs fail, so why not simply
> > count failed 0-order allocs, if one succeeds, reset counter. If a page is
freed
> > reset counter. If counter reaches <new magic number> then you're oom. No
timing
> > involved, which means you can have as much mem or as slow host as you like.
>
> > It isn't even really interesting, if you have swap or not, because a
> > failed 0-order alloc tells you whatever mem you have, there is surely
> > not much left.
>
> Wrong. If we have swap available, we are able to swapout anonymous data,
> so we are _not_ OOM. This is an important point on this whole OOM killer
> nightmare.
I guess this is not the complete picture, either. There may as well be a
situation, where there is nothing to swap out left, but still swap-space
available. Anyway you would be deadlocked in this situation. The only thing you
can see is the failing allocs (and of course no frees). You will never enter
oom-state, if you make "available swap" a negative-trigger. It _sounds_ good,
but _is_ wrong.
> Keep in mind that we don't want to destroy anonymous data from userspace
> (OOM kill).
>
> > I'd try about 100 as magic number.
>
> I think your suggestion will work well in practice (except that we have to
> check the swap).
>
> I'll try that later.
>
> > > /proc tunable (eeek) ?
> >
> > NoNoNo, please don't do that!
>
> Note that even if your suggestion works, we may want to make the magic
> value /proc tunable.
Well, in fact I really think my suggestion may be better than the current
implementation, but do believe that it is not quite like "42". Whenever you
hear someone talk about magic numbers/limits, keep in mind its only because he
doesn't have the _complete_ answer to the question. I'm in no way different. I
don't like my magic number, only I have no better answer.
>
> The thing is that the point where tasks should be killed is also an admin
> decision, not a complete kernel decision.
I completely disagree. There can only be two completely independant ways for
this oom stuff:
1) the kernel knows
2) the admin knows
You suggest 2), but then you have to make a totally different approach to the
problem. Because if admin knows, then it's very likely, that he even knows
_which_ application should be killed, or even better, which should _not_ be
killed.
He (the admin) would like to have an option to choose this for sure. You cannot
really solve this idea _inside_ the kernel, I guess. I think this would better
be solved as an oom-daemon with a config-file in /etc, where you tell him,
"whatever is bad, don't kill google". This would be Bens' config file :-)
Regards,
Stephan
next prev parent reply other threads:[~2001-11-06 14:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-06 11:40 out_of_memory() heuristic broken for different mem configurations Marcelo Tosatti
2001-11-06 13:31 ` Stephan von Krawczynski
2001-11-06 12:22 ` Marcelo Tosatti
2001-11-06 14:21 ` Stephan von Krawczynski [this message]
2001-11-06 14:02 ` Marcelo Tosatti
2001-11-06 15:25 ` Linus Torvalds
2001-11-06 14:19 ` Marcelo Tosatti
2001-11-06 17:23 ` Marcelo Tosatti
2001-11-06 16:05 ` Stephan von Krawczynski
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=20011106152136.3db4ee73.skraw@ithnet.com \
--to=skraw@ithnet.com \
--cc=andrea@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
--cc=torvalds@transmeta.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