Re: swap space: an idea. Please comment.

Ingo Molnar (mingo@pc5829.hil.siemens.at)
Sun, 23 Feb 1997 19:01:17 +0100 (MET)


On Sun, 23 Feb 1997, Riccardo Facchetti wrote:

> Now the idea.
> Why not have an (I called) "adaptive" or if you prefer (I don't :)
> "dynamic" swap file, managed in kernel space, that can grow and shrink
> when memory is needed and/or released by someone ?

i think you can do already most of this in user-space.

Just start a small daemon that monitors swap space usage, and when swap
space is getting short, it adds partitions/files. (it can even create
those files on the fly).

there might be some lag between bad swap space conditions and the daemon
though. If you are really worried about this lag, make the daemon a kernel
thread, use a global waitqueue for 'out of memory' processes, and kick the
daemon when swap space is short. [you've got to identify 'out of memory'
situations properly].

but isnt 'getting no memory' a better answer than 'the system is useless
due to trashing'?

-- mingo