Re: Static Swap

Gregory Maxwell (linker@z.ml.org)
Tue, 13 Apr 1999 18:02:07 -0400 (EDT)


Heheh...

I'm not quite sure why you would want to do this with ram and hdd
prices today, on a normal system you should plan on having 2x more swap
then you will ever need so if you are actually getting close to running
out then you have bigger problems.

But,

You need to make a daemon which calls the approiate systems calls to
determin free swap and automaticly makes on disk swapfiles in 5-50meg
chuncks.. It should do everything by itself (no calling external programs)
and it should be mlocked and small..

Here's what needs to be done,

mlock code
check free swap
if free_swap< 25% and n_swaps<max_swaps {
dd if=/dev/zero of=/path/swap.n bs=1024 count=32768
mkswap /path/swap.n
swapon /path/swap.n
n_swaps++
}
sleep 1;

On Tue, 13 Apr 1999 pramod@anaconda.ee.iitm.ernet.in wrote:

> Hi everyone ,
> I wanted to know wether linux can instead of having a static
> size swap have a dynamic size swap . That is if there is disk space
> available that is there is no valid data , that could be used for swap .
> Static swap also has a problem that when I increase my ram the swap also
> has to be increased for faster performance but cant be done because the
> partitions are all made . I want to know wether any attempts are being
> made along this front . I am an enthusiastic programmer and would like to
> contribute for the above . Please mail me as I am not a member of this
> group .
>
> Pramod .
>
> 00000000 00000000 77777777777777777
> 00000 000 00000 000 77777777777777777
> 00000 0000 00000 0000 7777 777777 =========== ##
> 00000 0000 00000 0000 7777 777777 ###################
> 00000 00000 00000 00000 777777 ##############
> 00000 00000 00000 00000 777777 ##( //
> 00000 00000 00000 00000 7777777 //
> 00000 000000 00000 000000 777777 --------/
> 00000 000000 00000 000000 7777777
> 00000 000000 00000 000000 7777777
> 0000 00000 0000 00000 7777777
> 000 00000 000 00000 777777
> 00000000 00000000 777777
>
>
> -
> 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/
>

-
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/