Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Mar 2003 15:00:59 -0500
From:      Garance A Drosihn <drosih@rpi.edu>
To:        "Daniel C. Sobral" <dcs@tcoip.com.br>
Cc:        Juli Mallett <jmallett@FreeBSD.org>, Eivind Eklund <eivind@FreeBSD.org>, Mike Silbersack <silby@silby.com>, 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:  <p05200f2aba97e388a185@[128.113.24.47]>
In-Reply-To: <3E720B5B.8090200@tcoip.com.br>
References:  <200303122313.h2CNDHMU046431@repoman.freebsd.org> <20030312175458.J32334@odysseus.silby.com> <20030313005115.GA11794@HAL9000.homeunix.com> <20030313154226.X682@odysseus.silby.com> <20030314012954.A42430@FreeBSD.org> <20030314101857.A98861@FreeBSD.org> <p05200f28ba97b4007dab@[128.113.24.47]> <3E720B5B.8090200@tcoip.com.br>

next in thread | previous in thread | raw e-mail | index | archive | help
At 2:03 PM -0300 3/14/03, Daniel C. Sobral wrote:
>Garance A Drosihn wrote:
>>
>>AIX (and maybe some other systems?) have a signal called SIGDANGER,
>>which is meant for this kind of situation.  If we implement some
>>new signal, then perhaps it would be good to use that signal name
>>and mimic their implementation of it.
>
>Yes, SIGDANGER has the same default action as SIGTERM. If the
>application installs a handler, fine. Otherwise, it dies.

Not quite right.  From the description at:

http://nscp.upenn.edu/aix4.3html/aixbman/baseadmn/pag_space_under.htm

      When the number of free paging-space blocks falls below a
      threshold known as the paging-space warning level, the system
      informs all processes (except kprocs) of this condition by
      sending the SIGDANGER signal.

      If the shortage continues and falls below a second threshold
      known as the paging-space kill level, the system sends the
      SIGKILL signal to processes that are the major users of
      paging space and that do not have a signal handler for the
      SIGDANGER signal (the default action for the SIGDANGER signal
      is to ignore the signal). The system continues sending SIGKILL
      signals until the number of free paging-space blocks is above
      the paging-space kill level.

      Processes that dynamically allocate memory can ensure that
      sufficient paging space exists by monitoring the paging-space
      levels with the psdanger subroutine or by using special
      allocation routines. You can use the disclaim subroutine to
      prevent processes from ending when the paging-space kill
      level is reached. To do this, define a signal handler for
      the SIGDANGER signal and release memory and paging-space
      resources allocated in their data and stack areas and in
      shared memory segments.

(there is a bit more written at the web page).

A process can install a SIGACTION signal handler because it *does*
want to free up memory when the system hits the first threshold
level, or because it does *not* want to get killed when the system
reaches the second threshold level.

It seems to me that this would provide processes with most of the
control that they need, and it provides the correct "default
behavior" for processes which do not install the signal handler.

-- 
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?p05200f2aba97e388a185>