Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Mar 2003 16:59:20 -0500
From:      Garance A Drosihn <drosih@rpi.edu>
To:        Mike Silbersack <silby@silby.com>
Cc:        Poul-Henning Kamp <phk@phk.freebsd.dk>, "Daniel C. Sobral" <dcs@tcoip.com.br>, Juli Mallett <jmallett@FreeBSD.org>, Eivind Eklund <eivind@FreeBSD.org>, David Schultz <das@FreeBSD.org>, src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/vm ... SIGDANGER
Message-ID:  <p05200f2eba97fc3b6b96@[128.113.24.47]>
In-Reply-To: <20030314152510.A4480@odysseus.silby.com>
References:  <8023.1047662161@critter.freebsd.dk>    <p05200f2bba97e5a92150@[128.113.24.47]>    <20030314140414.V4480@odysseus.silby.com> <p05200f2cba97ef395f0e@[128.113.24.47]> <20030314152510.A4480@odysseus.silby.com>

next in thread | previous in thread | raw e-mail | index | archive | help
At 3:31 PM -0600 3/14/03, Mike Silbersack wrote:
>On Fri, 14 Mar 2003, Garance A Drosihn wrote:
>
>>  >In case #2, SIGDANGER wouldn't help much; how much ram can the
>>  >actively running, legitimate programs really save?
>  >
>  > Thus, the mere presence of the signal-handler will make sure
>  > that X is never the thing that gets killed.  The SIGDANGER
>  > signal-handler that I added to 'lpd' (at RPI) has the name
>  > "ignore_danger"...
>
>Well, if that's all SIGDANGER did for you,

It is better than what FreeBSD presently provides for the same
situation.  And maybe it sounds lame, but it did in fact work.

>then I'd advocate an approach which prioritizes lower uid programs
>and/or lower (higher?) nice values. Then lpd _and other important
>processes_ would be automatically protected.

Again, I do not think we should tie the "willingness to die" to
nice-sounding but arbitrary distinctions like this.  The fact
that I run something as root does not mean that the process has
no intelligence about what it could do to help the system when
memory is low.  This also goes against the desire to have more
and more things running as the "regular userid", instead of
needing to be root or some other priv userid to run.

Or take the case of lpd.  There is one process named lpd which
must keep running all the time.  To empty a print queue, that
process forks.  It would not be a crisis if a hundred queue-
specific processes were to die, but that main process does need
to keep running.  All the processes are the same userid.  They
run at the same nice level -- unless you change the source code,
but then everyone screams at how undesirable SIGACTION is because
you have to change the source code.

Almost all of the suggestions that have come forward are good
ideas to do *in addition* to SIGDANGER, but SIGDANGER provides
a program with a way to SPECIFICALLY address this very SPECIFIC
issue, without having to care what UID it got, or what nice
value it's willing to run at, or any other unrelated-to-VM
actions that it is doing.  There is no way that any guessing
strategy is going to be better than providing a specific facility
which can be used to address a specific issue.

Now, most programs won't take advantage of that specific facility,
at which point all these other ideas are good ideas for how to make
a smarter guess at what best to kill.  But if you only rely on a
better guessing algorithm, then no matter what algorithm you come
up with it is going to "guess wrong".  That is fact.  And when a
frustrated user sees that wrong guess, it would be nice if they
had some explicit way to force the "guess" to work out better in
their specific situation, for the specific set of processes they
are running.

Well, I think I've worded this in about as many different ways
as I can word it without sounding obnoxious, so I'll give it a
rest for awhile.  I do think my "modified SIGDANGER idea" is a
fairly attractive one (that's the one which includes a way for an
administrator to set behavior without recompiling any programs)

-- 
Garance Alistair Drosehn            =   gad@gilead.netel.rpi.edu
Senior Systems Programmer           or  gad@freebsd.org
Rensselaer Polytechnic Institute    or  drosih@rpi.edu

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-src" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?p05200f2eba97fc3b6b96>