mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@turbolinux.com>
To: Martin Dalecki <dalecki@evision-ventures.com>
Cc: Ingo Oeser <ingo.oeser@informatik.tu-chemnitz.de>,
	Jonathan Morton <chromi@cyberspace.org>,
	Rogier Wolff <R.E.Wolff@bitwizard.nl>,
	linux-kernel@vger.kernel.org
Subject: Re: OOM killer???
Date: Tue, 27 Mar 2001 12:55:50 -0700 (MST)	[thread overview]
Message-ID: <200103271955.f2RJtoH05928@webber.adilger.int> (raw)
In-Reply-To: <3AC0E4D9.E157D407@evision-ventures.com> from Martin Dalecki at "Mar 27, 2001 09:07:05 pm"

Martin Dalecki writes:
> Ingo Oeser wrote:
> > So as Rik stated: The OOM killer cannot suit all people, so it
> > has to be configurable, to be OOM kill, not overkill ;-)
> 
> Irony: Why then not store this information permanently - inside
> the UID of the application?

Because in some cases (large companies and such) the UID is centrally
controlled across all machines in the company, so there are > 100 (or
500 or 1000) "system" UIDs.  At one company I did work for, there were
dozens (maybe > 100) oracle instances alone (each with different UID
and passwords for security), and lots more "system" application UIDs,
each unique.

Encoding more information into the UID is getting back to the bad old
days of "uid 0" is can do anything, rather than the capability model we
are working towards.  Even so, encoding process killability info in the
UID is _still_ not putting policy in user space, because if you don't
like how the OOM killer works you still need to recompile and reboot.

Having a configurable OOM killer is not overkill, IMHO, because it is
only called in very rare cases (i.e. OOM is hopefully a rare event),
so it is definitely not on the fast path.  I'm sure people will agree
that spending a few extra cycles to kill the correct process is far
better than killing a lot of incorrect processes quickly.

Every time this subject comes up, I point to AIX and SIGDANGER - a signal
sent to processes when the system gets OOM.  If the process has registered
a SIGDANGER handler, it has a chance to free cache and such (or do a clean
shutdown), otherwise the default signal handler will kill the process.

SIGDANGER would fix the original problem (killing numerical methods
application running for weeks) perfectly - the application can freely
allocate cache memory to speed up the calculations.  When system gets
OOM (for whatever reason), it sends SIGDANGER to applications first and
they can free buffers or do safe shutdown, and this may get system out
of OOM case without having to kill anything.

Granted, I'm not against fixing the VM to reducing OOM conditions in the
first place.  Having SIGDANGER still gives the application a chance to
save itself before it is killed, which none of the OOM changes have
addressed at all.  It is _still_ possible to get a system into OOM from
network buffers and such, regardless of whether an application is
calling malloc() returns NULL or not.

Also, having a SIGDANGER handler _could_ reduce a process "badness"
value when looking for processes to SIGKILL, when calling all of the
SIGDANGER handlers has not freed enough memory to get out of OOM.  This
assumes that programs which register SIGDANGER handlers are important,
rather than malicious (in which case your system has other problems).

Cheers, Andreas
-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert

  reply	other threads:[~2001-03-27 19:59 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-27 10:59 Rogier Wolff
2001-03-27 12:14 ` Jonathan Morton
2001-03-27 13:24   ` Martin Dalecki
2001-03-27 18:08     ` Ingo Oeser
2001-03-27 19:07       ` Martin Dalecki
2001-03-27 19:55         ` Andreas Dilger [this message]
2001-03-27 21:13           ` Andreas Rogge
2001-03-27 13:57   ` Jonathan Morton
2001-03-27 15:31   ` Jonathan Lundell
2001-03-27 16:07     ` Config bug? In 2.2.19 CONFIG_RTL8139 depends on CONFIG_EXPERIMENTAL Greg Ingram
2001-03-27 16:14       ` Jeff Garzik
2001-03-27 16:37         ` [PATCH] 2.2.19 drivers/net/Config.in Greg Ingram
2001-03-27 18:37   ` OOM killer??? Jonathan Morton
     [not found] <200103282138.f2SLcT824292@webber.adilger.int>
2001-03-29  9:29 ` Dr. Michael Weller
2001-03-29 11:01   ` Guest section DW
2001-03-29 12:02     ` Sean Hunter
2001-03-29 12:57       ` Guest section DW
2001-03-29 15:41     ` David Konerding
2001-03-29 17:52       ` David Lang
2001-03-29 17:21     ` Stephen Satchell
2001-03-30  2:26     ` Michael Peddemors
2001-03-30 14:48       ` J. Scott Kasten
2001-03-29 13:53   ` Szabolcs Szakacsits
2001-03-29 15:01     ` Dr. Michael Weller
2001-03-29 16:29       ` Szabolcs Szakacsits
2001-03-29 16:51       ` Szabolcs Szakacsits
2001-03-29 16:22 Jesse Pollard
2001-03-29 19:20 Jesse Pollard

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=200103271955.f2RJtoH05928@webber.adilger.int \
    --to=adilger@turbolinux.com \
    --cc=R.E.Wolff@bitwizard.nl \
    --cc=chromi@cyberspace.org \
    --cc=dalecki@evision-ventures.com \
    --cc=ingo.oeser@informatik.tu-chemnitz.de \
    --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

all inboxes | Powered by JetHome®