From: jfm2@club-internet.fr
To: H.H.vanRiel@phys.uu.nl
Cc: jfm2@club-internet.fr, sct@redhat.com, linux-mm@kvack.org
Subject: Re: Two naive questions and a suggestion
Date: 26 Nov 1998 19:59:42 -0000 [thread overview]
Message-ID: <19981126195942.1431.qmail@sidney.remcomp.fr> (raw)
In-Reply-To: <Pine.LNX.3.96.981126080204.24048J-100000@mirkwood.dummy.home> (message from Rik van Riel on Thu, 26 Nov 1998 08:16:04 +0100 (CET))
> On 25 Nov 1998 jfm2@club-internet.fr wrote:
>
> > > I sounds remarkably like you want my Out Of Memory killer
> > > patch. This patch tries to remove the randomness in killing
> > > a process when you're OOM by carefully selecting a process
> > > based on a lot of different factors (size, age, CPU used,
> > > suid, root, IOPL, etc).
> >
> > Your scheme is (IMHO) far too complicated and (IMHO) falls short.
> > The problem is that the kernel has no way to know what is the really
> > important process in the box.
>
> In my (and other people's) experience, an educated guess is
> better than a random kill. Furthermore it is not possible to
> get out of the OOM situation without killing one or more
> processes, so we want to limit:
> - the number of processes we kill (reducing the chance of
> killing something important)
> - the CPU time 'lost' when we kill something (so we don't
> have to run that simulation for two weeks again)
> - the risk of killing something important and stable, we
> try to avoid this by giving less hitpoints to older
> processes (which presumably are stable and take a long
> time to 'recreate' the state in which they are now)
> - the amount of work lost -- killing new processes that
> haven't used much CPU is a way of doing this
> - the probability of the machine hanging -- don't kill
> IOPL programs and limit the points for old daemons
> and root/suid stuff
>
> Granted, we can never make a perfect guess. It will be a
> lot better than a more or less random kill, however.
>
> The large simulation that's taking 70% of your RAM and
> has run for 2 weeks is the most likely victim under our
> current scheme, but with my killer code it's priority
> will be far less that that of a newly-started and exploded
> GIMP or Netscape...
>
My idea was:
-VM exhausted and process allocating is a normal process then kill
process.
-VM exhausted and process is a guaranteed one then kill a non
guaranteed process.
-VM exhausted, process is guaranteed but only remaining processes are
guaranteed ones. Kill allocated process.
Of course INIT is guaranteed.
> > Why not simply allow a root-owned process declare itself (and the
> > program it will exec into) as "guaranteed"?
>
> If the guaranteed program explodes it will kill the machine.
> Even for single-purpose machines this will be bad since it
> will increase the downtime with a reboot&fsck cycle instead
> of just a program restart.
>
Nope see higher. The guaranteed program would be killed once
"unimportant" processes have been killed. The goal is not to allow
impunity to guaranteed programs but to protect an important program
against possible misbehaviour of other programs: a misbehaving process
who has allocated all the VM except 1 page and then our database
server tries to allocate two more pages.
> > Or a box used as a mail server using qmail: qmail starts sub-servers
> > each one for a different task.
>
> The children are younger and will be killed first. Starting
> the master server from init will make sure that it is
> restarted in the case of a real emergency or fluke.
>
> > Of course this is only a suugestion for a mechanism but the important
> > is allowing a human to have the final word.
>
> What? You have a person sitting around keeping an eye on
> your mailserver 24x7? Usually the most important servers
> are tucked away in a closet and crash at 03:40 AM when
> the sysadmin is in bed 20 miles away...
>
No. The sysadmin uses emacs at normal hours to edit a file telling
what are the important processes. Now it is to you to find a scheme
in order the sysadmin's wishes are communicated to the kernel. :-)
--
Jean Francois Martinez
Project Independence: Linux for the Masses
http://www.independence.seul.org
--
This is a majordomo managed list. To unsubscribe, send a message with
the body 'unsubscribe linux-mm me@address' to: majordomo@kvack.org
next prev parent reply other threads:[~1998-11-26 20:24 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-11-19 0:20 jfm2
1998-11-19 20:05 ` Rik van Riel
1998-11-20 1:25 ` jfm2
1998-11-20 15:31 ` Eric W. Biederman
1998-11-23 18:08 ` Stephen C. Tweedie
1998-11-23 20:45 ` jfm2
1998-11-23 21:59 ` jfm2
1998-11-24 1:21 ` Vladimir Dergachev
1998-11-24 11:17 ` Stephen C. Tweedie
1998-11-24 21:44 ` jfm2
1998-11-25 6:41 ` Rik van Riel
1998-11-25 12:27 ` Stephen C. Tweedie
1998-11-25 13:08 ` Rik van Riel
1998-11-25 14:46 ` Stephen C. Tweedie
1998-11-25 16:47 ` Rik van Riel
1998-11-25 21:02 ` Stephen C. Tweedie
1998-11-25 21:21 ` Rik van Riel
1998-11-25 22:29 ` Stephen C. Tweedie
1998-11-26 7:30 ` Rik van Riel
1998-11-26 12:48 ` Stephen C. Tweedie
1998-11-25 20:01 ` jfm2
1998-11-26 7:16 ` Rik van Riel
1998-11-26 19:59 ` jfm2 [this message]
1998-11-27 17:45 ` Stephen C. Tweedie
1998-11-27 21:14 ` jfm2
1998-11-25 14:48 ` Eric W. Biederman
1998-11-25 20:29 ` jfm2
1998-11-25 16:31 ` ralf
1998-11-26 12:18 ` Rik van Riel
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=19981126195942.1431.qmail@sidney.remcomp.fr \
--to=jfm2@club-internet.fr \
--cc=H.H.vanRiel@phys.uu.nl \
--cc=linux-mm@kvack.org \
--cc=sct@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