[linux-mm-cc] Swapping to RAM activates harddrive.
Ole Tange
ole at tange.dk
Wed Jul 27 08:35:09 EDT 2011
I am trying to test compcache on my 8 GB laptop before putting compcache
into production on our 256 GB servers.
It is, however, not working out very well.
- o -
For my first test I want to compress swap to RAM without touching the disk
drive at all. I have disabled back storage and stopped swapping to my normal
swap partition.
I run a program that eats up a lot of memory but the memory is highly
compressible (containings 80 * 100M strings with 'X')
When the program hits 6 GB the disk becomes active. I can understand why the
swap becomes active at 6 GB (that is the whole idea), but why does the DISK
become active?
$ uname -a
Linux ole-laptop 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC
2011 x86_64 x86_64 x86_64 GNU/Linux
$ sudo swapoff /dev/ramzswap?
$ sudo modprobe -r ramzswap
$ sudo modprobe -r lzo_compress
FATAL: Module lzo_compress is builtin
$ sudo modprobe -r lzo_decompress
FATAL: Module lzo_decompress is builtin
$ sudo modprobe lzo_compress
$ sudo modprobe lzo_decompress
$ sudo modprobe ramzswap
$ sudo swapoff /dev/sda5
swapoff: /dev/sda5: swapoff failed: Invalid argument
$ sudo rzscontrol /dev/ramzswap0 --init
init: Inappropriate ioctl for device
$ sudo mkswap /dev/ramzswap0
Setting up swapspace version 1, size = 2031948 KiB
no label, UUID=6a7facf4-225e-4c19-9d69-98aa9c3d62fa
$ sudo swapon -p 100 /dev/ramzswap0
$ cat /proc/swaps
Filename Type Size Used
Priority
/dev/ramzswap0 partition 2031948 0 100
$
$ perl -e '$a="X"x100000000; @a=(1..80);while(1) { my $b=$a; push @a,$b;
shift @a; print $t++,"\n"; sleep 1 }'
<<disk becomes active after 60 seconds>>
$ sudo rzscontrol /dev/ramzswap0 -s
stats: Inappropriate ioctl for device
/Ole
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.laptop.org/pipermail/linux-mm-cc/attachments/20110727/3f62d7c6/attachment.html>
More information about the linux-mm-cc
mailing list