Re: On the issue of low memory situations

From: Nicholas Vinen (hb@sonique.com)
Date: Fri Mar 17 2000 - 21:51:13 EST


On Fri, 17 Mar 2000, Linda Walsh wrote:

> Nicholas Vinen wrote:
> >
> > On Fri, 17 Mar 2000, Linda Walsh wrote:
> >
> > > I haven't read through this whole thread, so this may have been
> > > suggested, but why not have a new signal "SIGNMEM". Can't be caught but
> > > can be ignored. Default is to take the signal and terminate the program
> > > that faulted. If ignored, put process to sleep until the memory request
> > > can be satisfied. Then something like 'X' or apache could ignore, while
> > > 'gcc' would just die.
> >
> > Well, it might even be useful to be able to catch it.
> ---
> It's possible to define a 'catch' behavior, but it couldn't be
> guaranteed, since calling the signal handler would demand space on the
> stack which could result in another needed page. I suppose you could
> have the behavior defined such that the signal would be reset to default
> behavior (don't catch) before calling the signal handler. Then if it
> faulted a second time before the signal handler could re-register
> itself, the process dies.
>
> -l

        Well, you could use SA_RESETHAND with sigaction to specify that
behaviour but yes, you'd expect that you would almost always want that.
However I do think that such a signal should be triggered before memory is
TOTALLY exhaused (perhaps if you trigger the allocation of the 5th last
page in existance or something). This way you have enough pages to do your
cleanup at least.

        OK, now the only issue is who is going to write this. I'm kinda
busy this weekend ;) Shouldn't be too hard though. Anyone?

                Nicholas

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Mar 23 2000 - 21:00:23 EST