mfrw / compcache

Automatically exported from code.google.com/p/compcache
0 stars 0 forks source link

backing store usage #27

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I tried the backing store load and it complains about the memlimit_kb value
no matter what value I choose.  Invalid parameter..

What's the difference between having a ram disk as a swap drive and using a
backing store parameter?

Original issue reported on code.google.com by mar...@snoutfarm.com on 27 Feb 2009 at 2:28

GoogleCodeExporter commented 9 years ago
> I tried the backing store load and it complains about the memlimit_kb value
> no matter what value I choose.  Invalid parameter..

Try SVN r304

> What's the difference between having a ram disk as a swap drive and using a
> backing store parameter?

Without backing store, compcache has to keep all pages in memory - even if they 
are
incompressible! (in which case it stores them uncompressed). Also, we have no 
way to
move pages in compcache to another swap device (if present).

With backing store, we can forward such incompressible pages to backing store. 
By
default only pages that compress to less than 1/2 of its size are kept in 
compcache
and rest are sent to backing store. Also, we now have a way to move compcache 
pages
to this backing store in case system is really low on memory (this part not yet
implemented).

Original comment by nitingupta910@gmail.com on 27 Feb 2009 at 4:55

GoogleCodeExporter commented 9 years ago
> Try SVN r304

Hmm, no, same problem..  (on a PS3 -- PPC)

Original comment by mar...@snoutfarm.com on 27 Feb 2009 at 2:18

GoogleCodeExporter commented 9 years ago
> Hmm, no, same problem..  (on a PS3 -- PPC)

Just to rule-out trivial issue, please confirm if syntax you are using is same 
as below:

 * using script:

./use_compcache.sh 50000 /dev/sda2

(where 50000 is memlimit_kb and /dev/sda2 is backing_dev - my swap partition)

 * or manually load all modules as:

modprobe lzo_compress
modprobe lzo_decompress
insmod ./xvmalloc.ko
insmod ./compcache.ko memlimit_kb=50000 backing_dev=/dev/sda2

Original comment by nitingupta910@gmail.com on 2 Mar 2009 at 8:35

GoogleCodeExporter commented 9 years ago
Looks like the problem is in use_compcache.sh where it quotes the parameter 
string to
insmod.   The effect is like:

insmod ./compcache.ko "memlimit_kb=50000 backing_dev=/dev/sda2"

which it then complains about that single string having the wrong syntax for
memlimit_kb. 

Original comment by mar...@snoutfarm.com on 2 Mar 2009 at 2:31

GoogleCodeExporter commented 9 years ago
I tested and insmod ./compcache.ko "memlimit_kb=50000 backing_dev=/dev/sda2" 
works as
such. Your problem looks really strange.

Original comment by nitingupta910@gmail.com on 3 Mar 2009 at 4:03

GoogleCodeExporter commented 9 years ago
You can also get "Invalid parameter" error when partition given to backing_dev 
is not
really a swap partition. e.g. when tried using /dev/sdb2 as backing dev on my 
system
(its ext3 part):

# sudo ./use_compcache.sh 50000 /dev/sdb2

Setting up swap device ...
swapon: /dev/ramzswap0: Invalid argument

Since /dev/sdb2 is not a swap partition as fdisk shows:
# sudo fdisk -l
<snip
/dev/sdb2              33         512      983040   83  Linux  <-- not a swap 
part.
</snip>

To debug further, please send me these files when you get this error:
 - your kernel log (on Fedora its /var/log/messages - not sure about your setup)
 - /proc/swaps
 - output of lsmod
 - output of fdisk -l

Thanks.

Original comment by nitingupta910@gmail.com on 3 Mar 2009 at 4:23

GoogleCodeExporter commented 9 years ago
Hi,

Here's that output.   It really looks to me like the insmod syntax is the issue.
By the way, it's kernel 2.6.29-rc6.

Original comment by mar...@snoutfarm.com on 4 Mar 2009 at 4:03

Attachments:

GoogleCodeExporter commented 9 years ago
I see no error after:

[root@ps3 compcache-read-only]# /sbin/insmod ./compcache.ko memlimit_kb=50000
backing_dev=/dev/ps3da3

PS: after you load this module, you need to issue swapon on /dev/ramzswap0 
(this is
what script also does) - compcache will then fwd incompressible pages to 
backing_dev
(/dev/ps3da3).

----
So looks like issue with use_compcache.sh script as you mentioned in comment 4.

Original comment by nitingupta910@gmail.com on 4 Mar 2009 at 4:36

GoogleCodeExporter commented 9 years ago
Try SVN r308.

INSMOD() function in use_compcache.sh was passing both params as a single 
string.
Following test program shows that this will cause them to be treated as a single
param. So now it separates params as individual strings to pass to insmod cmd.

// param.c
#include <stdio.h>

int main(int argc, char *argv[])
{
        int i;

        printf("argc=%d\n", argc);

        for (i = 0; i < argc; i++)
                printf("%d: %s\n", i, argv[i]);

        return 0;
}

[ngupta param]$ ./param test1 test2
argc=3
0: ./param
1: test1
2: test2

[ngupta param]$ ./param "test1 test2"
argc=2
0: ./param
1: test1 test2

Original comment by nitingupta910@gmail.com on 4 Mar 2009 at 8:31

GoogleCodeExporter commented 9 years ago
Great, that patch works.

Original comment by mar...@snoutfarm.com on 5 Mar 2009 at 2:06

GoogleCodeExporter commented 9 years ago

Original comment by nitingupta910@gmail.com on 5 Mar 2009 at 3:09