Date: Mon, 7 Jan 2008 20:58:53 +1100 From: Peter Jeremy <peterjeremy@optushome.com.au> To: Poul-Henning Kamp <phk@phk.freebsd.dk> Cc: Kostik Belousov <kostikbel@gmail.com>, freebsd-current@freebsd.org Subject: Re: sbrk(2) broken Message-ID: <20080107095853.GR947@server.vk2pj.dyndns.org> In-Reply-To: <8680.1199696915@critter.freebsd.dk> References: <20080104134829.GA57756@deviant.kiev.zoral.com.ua> <8680.1199696915@critter.freebsd.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
--4ybNbZnZ8tziJ7D6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 07, 2008 at 09:08:35AM +0000, Poul-Henning Kamp wrote: >In message <20080104134829.GA57756@deviant.kiev.zoral.com.ua>, Kostik Belo= usov=20 >writes: >>By making the default action for SIGDANGER to be SIG_IGN, this problem >>would be mostly solved. Only processes that actually care about SIGDANGER >>and installing the handler for it would require some non-trivial and >>resource-hungry operation. > >This is a non-starter, if SIGDANGER is to have any effect, all >processes that use malloc(3) should react to it. This depends on what SIGDANGER is supposed to indicate. IMO, a single signal is inadequate - you need a "free memory is less than desirable, please reduce memory use if possible" and one (or maybe several levels of) "memory is really short, if you're not important, please die". The former could reasonably default to SIG_IGN - processes that are in a position to release memory on demand could provide a handler to do so. (This could potentially include malloc returning space on its freelist to the kernel). The latter should default to "terminate process" and a process that considers itself "important" enough can trap it. --=20 Peter Jeremy Please excuse any delays as the result of my ISP's inability to implement an MTA that is either RFC2821-compliant or matches their claimed behaviour. --4ybNbZnZ8tziJ7D6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFHgffd/opHv/APuIcRArAEAJ4lZFneYuMnFjEFbamiQIjnzuxnvgCgsI3G 9cSYHSMUiNIDAbLiUHUauN4= =mByf -----END PGP SIGNATURE----- --4ybNbZnZ8tziJ7D6--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080107095853.GR947>