Re: Memory overcommitting

Andi Kleen (andi@mlm.extern.lrz-muenchen.de)
20 Feb 1997 07:35:06 +0100


"Brian E. Gallew" <geek+@CMU.EDU> writes:

>
> Pre-allocation: The old berkeley thing. No process is allowed to execute
> without sufficient swap to contain it. The image is written to swap before
> execution begins. Safest, slowest, and poorest use of resources.
>
> Pre-commission: No process is allowed to execute unless there is sufficient VM.
> Swap is only written upon demand. Evidently IRIX and Solaris support this
> mode. *Almost* as safe as pre-allocation, lots faster, and better use of
> resources.
>
> Optimistic: The Linux Way (tm). It is assumed that processes will often
> overallocate. Least safe, fastest, and best usage of resources.
>
> For those of you who dislike The Linux Way (tm), grab the source, write you
> *own* allocators, and provides patches for compile-time choosing among methods.
> If you aren't willing to write it yourself, then sit down and be quiet.

Or even better add a /proc/sys/vm entry. I once had a patch for 2.0.0
that allowed to choose between optimistic and the current Linux way (it's
something between optimistic and pre-allocation, see
/usr/src/linux/mm/mmap.c:vm_enough_memory()). The patches you're proposing
are very easy, just add them to vm_enough_memory().

IMHO people concerned about this should use ulimit -v and ulimit -u.
It works and doesn't need kernel patches.

-Andi