Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Apr 1998 09:16:51 -0400 (EDT)
From:      "David E. Cross" <dec@phoenix.its.rpi.edu>
To:        Terry Lambert <tlambert@primenet.com>
Cc:        adrian@virginia.edu, freebsd-hackers@FreeBSD.ORG
Subject:   Re: SIGDANGER
Message-ID:  <Pine.BSF.3.96.980429090025.2950A-100000@phoenix.its.rpi.edu>
In-Reply-To: <199804290208.TAA07145@usr01.primenet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 29 Apr 1998, Terry Lambert wrote:

> A probable optimization would be:
> 
> 	1)	Shoot everyopne with a "low memory condition" handler
> 	2)	wait
> 	3)	if memory is still low, shoot the highest working set
> 		without a handler and go to 2
> 	4)	Satisfy outstanding unsatisfied requests.

Hmm, I have a slighlty different idea... (the problem is, how long do
you wait? A hog process could take a couple of seconds to
complete and flush memory).
 
This is what I would prefer to see:

1) SIGDANGER (or whatever) would cause a program to terminate by default
2) To ignore this signal your uid or euid must be 0.
3) Anyone can install a signal handler.

the Kernel would then treat processes as follows:
1) Processes that did not have SIGDANGER handled would be the first to be
killed (just sent a SIGKILL).

2) next processes that had a handler installed would be sent SIGDANGER.

3) Finally processes with SIGDANGER ignored would be killed.

Presumably most processes would fall in group 1, and that could free up
the majority of processes.

As in the case of a process that dirtys a copy on write page when there is
no more memory, if the process does not have any SIGDANGER handling, just
kill it, otherwise complete step 1, if that does not free enough memory
then kill the offending process.

As there needs to be  wait time with sigdanger, I think that processes
that have sigdanger should be sent it when memory is 90% full, that will
be a proactive step to keep memory from running out in the first place.

--
David Cross


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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.980429090025.2950A-100000>