On Fri, 28 Sep 2007 16:36:34 +0200
Eric Dumazet <dada1@cosmosbay.com> wrote:
I suspect that SIGDANGER is not the right approach, because glibc
memory arenas cannot be manipulated from inside a signal handler.
Also, "nearly OOM" is not the only such signal we would want to
send to userspace programs. It would also be useful to inform
userspace programs when we are about to start swapping something
out, so userspace can discard cached data instead of having to
wait for disk IO in the future.
A unix signal cannot encapsulate two different messages, while
something like a "/dev/lowmem" device can simply be added into
the program's main poll() loop and give many different messages.
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan
-