linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ilias Biris <xyz.biris@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Subject: Re: User space out of memory approach
Date: Tue, 11 Jan 2005 11:27:21 -0400	[thread overview]
Message-ID: <4e1a70d10501110727168c0d54@mail.gmail.com> (raw)
In-Reply-To: <20050111104439.GJ26799@dualathlon.random>

Hi folks,

i believe the OOM has been a matter of frequent discussion for some
time now. The initial implementation was considered good enough for
some, ugly and inefficient in selecting the right task to kill for
others and downright unecessary for yet more of linux users. I belong
to somewhere in between the 1st and the second group.

I personally believe that heuristics never work 100% of the time, even
 when carefully thought of, as Andrea conceded. Nevertheless the
kernel needs some guidance upon which to base a decision. This
guidance can be a default, or a user-based solution  using whatever
possible algorithm to do the ranking. One thing is for sure, the
kernel should be the one to do the kill ...

I believe that we need to test some more and see what should be the
default ranking approach. Certainly Andrea's implementation looks
promising, but as a user I would like to opt if I feel capable to
implement my own ranking algorithm, in a way that is controlled by
myself.

my 2 cents

--
Ilias Biris


On Tue, 11 Jan 2005 11:44:39 +0100, Andrea Arcangeli <andrea@suse.de> wrote:
> On Tue, Jan 11, 2005 at 12:05:40PM +0200, Edjard Souza Mota wrote:
> > Deamon just started at user space, and does only calculation. It doesn't
> > take decision at all. That OOM killer at kernel level who get the list
> > and chooses
> > who to shoot dead.
> 
> Then this is exactly what the oomkilladj patch from Kurt is doing. You
> tune it with this:
> 
> andrea@dualathlon:~> cat /proc/self/oom_adj
> 0
> andrea@dualathlon:~> cat /proc/self/oom_score
> 627
> andrea@dualathlon:~>
> 
> (the second one is the score)
> 
> With this script I can tell exactly which is going to be the next killed
> task if the box were to run oom:
> 
> ls /proc/*/oom_score| grep -v self | sed 's/\(.*\)\/\(.*\)/echo -n "\1 "; cat \1\/\2/'|sh | sort -nr +1| head -n 1
> 
> In this case it would be pid 4175:
> 
> /proc/4175 32923
> andrea@dualathlon:~> ps 4175
>   PID TTY      STAT   TIME COMMAND
>  4175 ?        Ss     0:03 kdeinit: Running...
> andrea@dualathlon:~>
> 
> > Could be. Interesting idea. We shall keep thinking about it. Have you done
> > some experiment like that?
> 
> We ship it in production, it worked so far. Though I don't know if it's
> flexible as much as you need. Sure it's not going to make the oom killer
> worse to have some way of tuning it ;).
> 
> If you've a better API we can discuss it, the above was quite
> non-intrusive, it's simple and it does the trick so I don' dislike it.
> 
> Anyway as said in the other email, before discussing this stuff we
> should get the rest fixed. There were more serious problems than the
> task selection algorithm.
> 
> > Yes, agreed. Our point was just to re-organize current OOM killer to release the
> > kernel from doing rating, which is not its task any way.
> 
> I believe the kernel can have an huristic that gets right 99% of cases.
> But for sure the kernel *can't* always get it right, since only the
> admin knows the semantics and the importance of the stuff being
> computed, and the oomkilladj is there exactly to let the kernel learn
> about it too. The kernel has no clue that it's going to kill the
> database to leave a buggy videogame running, for the kernel all
> processes are important the same unless it's being tuned by userspace
> somehow.
> 
> The only thing the kernel can do is to take the best decision that will
> prevent more oom killing in the future. The kernel should exclude from
> the untuned selection all tasks that even if they're killed, the box
> would run out of memory again. So the one task that is allocating the
> memory at the fastest rate, is the best one to kill normally.  The
> current selection algorithm however is not taking into account the
> allocation rate at all and in turn I believe the current oom killer is
> quite far from the ideal oom killer. But this is a different topic, it
> has nothing to do with the current patches, nor with the userland
> tuning.
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

  parent reply	other threads:[~2005-01-11 15:27 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-10 21:43 User space out of memory approach Mauricio Lin
2005-01-10 19:20 ` Marcelo Tosatti
2005-01-10 19:39   ` Marcelo Tosatti
2005-01-10 23:01     ` Mauricio Lin
2005-01-10 22:40   ` Edjard Souza Mota
2005-01-10 20:05     ` Marcelo Tosatti
2005-01-10 23:17       ` Edjard Souza Mota
2005-01-10 23:18         ` Edjard Souza Mota
2005-01-10 23:24       ` Mauricio Lin
2005-01-10 23:30         ` Mauricio Lin
2005-01-11  7:47         ` Marcelo Tosatti
2005-01-11  0:35       ` Thomas Gleixner
2005-01-11  2:03         ` Edjard Souza Mota
2005-01-11  8:44           ` Thomas Gleixner
2005-01-11  8:58             ` Andrea Arcangeli
2005-01-11  7:48               ` Marcelo Tosatti
2005-01-11  9:08               ` Andrew Morton
2005-01-11  9:19                 ` Andrea Arcangeli
2005-01-11  9:27                   ` Andrew Morton
2005-01-11  9:20             ` Edjard Souza Mota
2005-01-11  9:30               ` Thomas Gleixner
2005-01-11  9:56                 ` Andrea Arcangeli
2005-01-11 10:05                   ` Edjard Souza Mota
2005-01-11 10:39                     ` Thomas Gleixner
2005-01-11 10:44                     ` Andrea Arcangeli
2005-01-11 14:56                       ` Edjard Souza Mota
2005-01-11 15:27                       ` Ilias Biris [this message]
2005-01-11 10:00                 ` Edjard Souza Mota
2005-01-11 10:36                   ` Thomas Gleixner
2005-01-11 16:32             ` Alan Cox
2005-01-11 19:16               ` Ilias Biris
2005-01-11 20:46                 ` Ilias Biris
2005-01-11 20:57                   ` Thomas Gleixner
2005-01-12  9:31                     ` Edjard Souza Mota
2005-01-12 11:19                       ` Thomas Gleixner
2005-01-12 12:12                         ` Edjard Souza Mota
2005-01-13 15:36                   ` Alan Cox
2005-01-16 10:06                     ` Edjard Souza Mota
2005-01-16 21:10                       ` Alan Cox
2005-01-17 10:16                         ` Thomas Gleixner
2005-01-11 21:35                 ` Denis Vlasenko
2005-01-11 20:40               ` Thomas Gleixner
2005-01-11  7:42         ` Marcelo Tosatti
2005-01-11 10:51           ` Thomas Gleixner
2005-01-11 11:03             ` Andrea Arcangeli
2005-01-11  8:38         ` Andrea Arcangeli
2005-01-21 21:27           ` Mauricio Lin
2005-01-21 21:45             ` Mauricio Lin
2005-01-22  3:32               ` Andrea Arcangeli
2005-01-25 21:13                 ` Mauricio Lin
2005-01-25 21:39                   ` Thomas Gleixner
2005-01-26  0:11                     ` Mauricio Lin
2005-01-26  0:49                       ` Andrea Arcangeli
2005-01-26 14:03                         ` Mauricio Lin
2005-01-27 18:54                         ` Mauricio Lin
2005-01-27 22:11                           ` Andrea Arcangeli
2005-01-27 22:29                             ` Andrew Morton
2005-01-27 22:58                               ` Andrea Arcangeli
2005-01-27 23:35                                 ` Andrew Morton
2005-01-28  0:15                                   ` Andrea Arcangeli
2005-01-28 13:58                             ` Mauricio Lin
2005-01-28 15:21                               ` Mauricio Lin
2005-01-28 15:29                                 ` Andrea Arcangeli
2005-01-26  7:26                       ` Thomas Gleixner
2005-01-22  3:04             ` Andrea Arcangeli
     [not found] <fa.lcmt90h.1j1scpn@ifi.uio.no>
     [not found] ` <fa.ht4gei4.1g5odia@ifi.uio.no>
2005-01-16 16:28   ` Bodo Eggert
2005-01-18 13:15     ` Edjard Souza Mota
2005-01-19  6:18       ` Bodo Eggert
2005-01-20  3:20         ` Edjard Souza Mota
2005-01-20  5:00           ` Bodo Eggert

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=4e1a70d10501110727168c0d54@mail.gmail.com \
    --to=xyz.biris@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).