From owner-freebsd-hackers Wed Apr 29 06:18:19 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA26216 for freebsd-hackers-outgoing; Wed, 29 Apr 1998 06:18:19 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from phoenix.its.rpi.edu (dec@phoenix.its.rpi.edu [128.113.161.45]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA26205 for ; Wed, 29 Apr 1998 06:18:13 -0700 (PDT) (envelope-from dec@phoenix.its.rpi.edu) Received: from localhost (dec@localhost) by phoenix.its.rpi.edu (8.8.8/8.8.7) with SMTP id JAA03276; Wed, 29 Apr 1998 09:16:51 -0400 (EDT) (envelope-from dec@phoenix.its.rpi.edu) Date: Wed, 29 Apr 1998 09:16:51 -0400 (EDT) From: "David E. Cross" To: Terry Lambert cc: adrian@virginia.edu, freebsd-hackers@FreeBSD.ORG Subject: Re: SIGDANGER In-Reply-To: <199804290208.TAA07145@usr01.primenet.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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