sbrk(2) broken

Peter Jeremy peterjeremy at optushome.com.au
Mon Jan 7 01:58:58 PST 2008


On Mon, Jan 07, 2008 at 09:08:35AM +0000, Poul-Henning Kamp wrote:
>In message <20080104134829.GA57756 at deviant.kiev.zoral.com.ua>, Kostik Belousov 
>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.

-- 
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20080107/ae8151a1/attachment.pgp


More information about the freebsd-current mailing list