From owner-freebsd-current@FreeBSD.ORG Mon Jan 7 09:58:58 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DF7316A419 for ; Mon, 7 Jan 2008 09:58:58 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail15.syd.optusnet.com.au (mail15.syd.optusnet.com.au [211.29.132.196]) by mx1.freebsd.org (Postfix) with ESMTP id 0C7A613C457 for ; Mon, 7 Jan 2008 09:58:57 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from server.vk2pj.dyndns.org (c220-239-20-82.belrs4.nsw.optusnet.com.au [220.239.20.82]) by mail15.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id m079wsbt019155 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 7 Jan 2008 20:58:55 +1100 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.2/8.14.1) with ESMTP id m079wsD0042696; Mon, 7 Jan 2008 20:58:54 +1100 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.2/8.14.2/Submit) id m079wrkU042695; Mon, 7 Jan 2008 20:58:53 +1100 (EST) (envelope-from peter) Date: Mon, 7 Jan 2008 20:58:53 +1100 From: Peter Jeremy To: Poul-Henning Kamp Message-ID: <20080107095853.GR947@server.vk2pj.dyndns.org> References: <20080104134829.GA57756@deviant.kiev.zoral.com.ua> <8680.1199696915@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4ybNbZnZ8tziJ7D6" Content-Disposition: inline In-Reply-To: <8680.1199696915@critter.freebsd.dk> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.17 (2007-11-01) Cc: Kostik Belousov , freebsd-current@freebsd.org Subject: Re: sbrk(2) broken X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2008 09:58:58 -0000 --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--