Re: memory overcommitment

Vladimir Dergachev (vladimid@seas.upenn.edu)
Wed, 19 Aug 1998 15:56:16 -0400 (EDT)


> On Wed, 19 Aug 1998, Stephen C. Tweedie wrote:
> >
> > Then initialise the memory after malloc; you know the pages are there by
> > that stage.
>
> That is no solution. Futhermore, if other processes are also touching
> overcommitted memory, the initialization might just crash the machine.
> What I'm saying is: if malloc() does not tell me it has a tough life
> finding free memory, and just returns space generously, I have no way to
> know it by myself (at least: no safe way).
> What about a system call just before a series of malloc() to tell the OS
> you are actually going to use this allocated memory?

I am probably a little late for this debate, but isn't this a little too
complex ? I mean if you don't need memory why call malloc and if you need
it you are going to use it anyway. What about situations you don't know
how much really you need it ? like getting data out from the network ?

I would venture that the right suggestion was proposed before:
kill offending processes on sight with _liberal_ restrictions.

Of course *how* to kill them is another matter. It would be good to have two
more signals: SIG_SUSPEND and SIG_RESUME. When the process gets SIG_SUSPEND
it is never given time by the kernel and can be safely swapped out to say
a low perfomance temporary swap in /tmp. Root then gets a notification about
this process and has an option to send a SIG_RESUME signal to let the process
continue anyways.

This could also be handy in the future if we ever wanted to implement "deep
suspend" feature - instead of system halt the kernel will send SIG_SUSPEND
to all running processes and then save it's data. The system will poweroff
and when it get's powered back the kernel will restore it's data and send
SIG_RESUME to all processes. Of course this will result in a lot of SIG_HUP
signals from lost connections, but the same could happen if you just
disconnected from the network to, say, carry your notebook to another room.

Vladimir Dergachev

vdergach@math.upenn.edu

-
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.altern.org/andrebalsa/doc/lkml-faq.html