All times are UTC-06:00




Post new topic  Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Mon Jan 26, 2009 3:46 pm 
Offline
Site Admin

Joined: Fri Sep 24, 2004 1:39 am
Posts: 1589
Location: Austin, TX
Hi guys,

I thought maybe some people might like to try this out on their Efika;

http://code.google.com/p/compcache/

I've mentioned it here previously but it was in a pretty terrible state back then. It has improved in leaps and bounds since then..

It's very easy to build and test. Don't use the kernel patch - it's out of date - but it will build and run from the script without a kernel recompile. Some features actually require a much newer kernel.. I hope to do some testing using the SUSE installer soon so that we can try and make it self-contained and not require a pre-configured swap partition on the disk (or one on a slow USB key :)

I've tested it with the SUSE 11.0 kernel on my Efika at the lab and gotten some reasonable results. With a cache value passed to "use_compcache" of 131072 (effectively making a 128MB swap disk, 262144 would give a 256MB disk - any bigger and there's a possibility it wouldn't compress enough to fit) the responsivity of the system went up compared to disk swapping, and I could open a considerable number more Firefox pages with just this enabled than with real swap-on-harddisk behind it (accessing the disk on the Efika is so slow..)

I am curious if we can resurrect the idea of using the "phram" MTD driver to use the graphics card as 32-64MB of extra swap at a lower priority therefore using compressed RAM first, then swapping to some reasonably high-performance memory (which otherwise would not be used) and THEN falling back to disk.

(Obviously ATA DMA support would be a boon as a backup but we don't seem to be getting anywhere with that)

If anyone manages to run a responsive full GNOME or KDE session, I will be very very impressed :)

I just thought I would put that out there and see what developers can come up with.. especially the Crux or Gentoo guys (hi!) and especially considering the "flash-based Netbook with low RAM" kind of problems trying to run a high-end desktop..

_________________
Matt Sealey


Top
   
PostPosted: Tue Jan 27, 2009 3:19 pm 
Offline
Site Admin

Joined: Fri Sep 24, 2004 1:39 am
Posts: 1589
Location: Austin, TX
Quote:
Nobody?

_________________
Matt Sealey


Top
   
 Post subject:
PostPosted: Wed Jan 28, 2009 2:25 am 
Offline

Joined: Thu Jul 28, 2005 12:41 am
Posts: 1066
On openSUSE 11.1 I ran into this:
Code:
linux-q50o:~/compcache-0.5.1 # make
make -C /lib/modules/2.6.27.7-czp-1216d/build M=/root/compcache-0.5.1 modules
make[1]: Entering directory `/usr/src/linux-2.6.27.7-9'
CC [M] /root/compcache-0.5.1/sub-projects/compression/lzo-kmod/lzo1x_decompress.o
CC [M] /root/compcache-0.5.1/sub-projects/compression/lzo-kmod/lzo1x_compress.o
CC [M] /root/compcache-0.5.1/sub-projects/allocators/xvmalloc-kmod/xvmalloc.o
CC [M] /root/compcache-0.5.1/compcache.o
/root/compcache-0.5.1/compcache.c: In function ‘compcache_init’:
/root/compcache-0.5.1/compcache.c:455: error: ‘QUEUE_FLAG_NONROT’ undeclared (first use in this function)
/root/compcache-0.5.1/compcache.c:455: error: (Each undeclared identifier is reported only once
/root/compcache-0.5.1/compcache.c:455: error: for each function it appears in.)
make[2]: *** [/root/compcache-0.5.1/compcache.o] Error 1
make[1]: *** [_module_/root/compcache-0.5.1] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.27.7-9'
make: *** [all] Error 2
It is on the 8610, with the exact same .config in /usr/src/linux as I'm running. It only has 4 extra options added to the regular SuSE .config, nothing else changed. I ran 'make prepare' in /usr/src/linux, without it, compilation fails at the beginning...

_________________
CzP
http://czanik.blogs.balabit.com/


Top
   
 Post subject:
PostPosted: Wed Jan 28, 2009 4:06 am 
Offline

Joined: Thu Jul 28, 2005 12:41 am
Posts: 1066
OK, unmodified openSUSE 11.1 i686 has the same problem:
Code:
bigone111:/tmp/compcache-0.5.1 # make
make -C /lib/modules/2.6.27.7-9-pae/build M=/tmp/compcache-0.5.1 modules
make[1]: Entering directory `/usr/src/linux-2.6.27.7-9-obj/i386/pae'
make -C ../../../linux-2.6.27.7-9 O=/usr/src/linux-2.6.27.7-9-obj/i386/pae/. modules
CC [M] /tmp/compcache-0.5.1/sub-projects/compression/lzo-kmod/lzo1x_decompress.o
CC [M] /tmp/compcache-0.5.1/sub-projects/compression/lzo-kmod/lzo1x_compress.o
CC [M] /tmp/compcache-0.5.1/sub-projects/allocators/xvmalloc-kmod/xvmalloc.o
CC [M] /tmp/compcache-0.5.1/compcache.o
/tmp/compcache-0.5.1/compcache.c: In function ‘compcache_init’:
/tmp/compcache-0.5.1/compcache.c:455: error: ‘QUEUE_FLAG_NONROT’ undeclared (first use in this function)
/tmp/compcache-0.5.1/compcache.c:455: error: (Each undeclared identifier is reported only once
/tmp/compcache-0.5.1/compcache.c:455: error: for each function it appears in.)
make[4]: *** [/tmp/compcache-0.5.1/compcache.o] Error 1
make[3]: *** [_module_/tmp/compcache-0.5.1] Error 2
make[2]: *** [sub-make] Error 2
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.27.7-9-obj/i386/pae'
make: *** [all] Error 2

_________________
CzP
http://czanik.blogs.balabit.com/


Top
   
PostPosted: Wed Jan 28, 2009 4:27 am 
Offline

Joined: Mon Dec 05, 2005 7:23 am
Posts: 32
Location: Germany
Quote:
I am curious if we can resurrect the idea of using the "phram" MTD driver to use the graphics card as 32-64MB of extra swap
something like this?

http://209.85.129.132/search?q=cache:_O ... ient=opera

or the more polished variant of the same

http://en.gentoo-wiki.com/wiki/TIP_Use_ ... rd_as_swap

_________________
Michal Schulz


Top
   
PostPosted: Wed Jan 28, 2009 9:03 am 
Offline
Site Admin

Joined: Fri Sep 24, 2004 1:39 am
Posts: 1589
Location: Austin, TX
Quote:
something like this?
Exactly like that - I've used it before from your article - however I am convinced there is a way it can be done WITHOUT obviating the use of graphics. Having a 128MB graphics card there seems to be kind of pointless if it's just fancy swap space.

Also, slram is the old driver, Linux 2.6.2x something came with a "phram" driver which is much, much better.

X.org can be set to only use 64MB of a graphics card with "VideoRam 65536" in the Device section - some drivers just don't take any notice although I do think the radeon one does. So everyone with a R9250 is safe :)

This would give you 64MB of extra swap, and still be able to run X.org stuff (and ironically since X.org won't mmap 128MB cards on the Efika without swap present, will let you boot the system with no swap at all.. enabling swap on the graphics card just makes it better :)

The problem is, can you guarantee this with the kernel framebuffer? Does DRI take X.org's settings? I've been trying to work that out for ages.

Did you try compcache?

@Peter; not sure why they did this. It built fine on the Efika (2.6.25) and on the Via EPIA I got the same thing (2.6.27). The problem is that swap discard compatibility (in compat.h) is enabled and this ability is used to bracket functionality when this flag doesn't exist in 2.6.27 (fine in 2.6.28 though). They probably need another define or something.

Just go to line 455 and comment it out. All this does is make the block queue think there is no seek cost (for instance, it will do scheduling of io read/writes if it's on a hard disk, but not if it's a flash drive). Without it, it schedules stuff.. but really it shouldn't make a great deal of difference.

I'll write it up as a bug in the compcache project page.

_________________
Matt Sealey


Top
   
 Post subject:
PostPosted: Wed Jan 28, 2009 9:14 am 
Offline

Joined: Thu Jul 28, 2005 12:41 am
Posts: 1066
OK, compiled fine on x86:
Code:
bigone111:/tmp/compcache-0.5.1 # ./use_compcache.sh
compcache size not given. Using default (25% of RAM).
Setting compcache size to ~983 MB ...
Loading modules ...
Setting up swap device ...
Done!
Will test 8610 next (I don't have a compile environment on my EFIKA right now, as the 8610 is at least 10x faster :-) ).

_________________
CzP
http://czanik.blogs.balabit.com/


Top
   
 Post subject:
PostPosted: Wed Jan 28, 2009 9:26 am 
Offline

Joined: Thu Jul 28, 2005 12:41 am
Posts: 1066
OK, looks better now:
Code:
linux-q50o:~/compcache-0.5.1 # make
make -C /lib/modules/2.6.27.7-czp-1216d/build M=/root/compcache-0.5.1 modules
make[1]: Entering directory `/usr/src/linux-2.6.27.7-9'
CC [M] /root/compcache-0.5.1/sub-projects/compression/lzo-kmod/lzo1x_decompress.o
CC [M] /root/compcache-0.5.1/sub-projects/compression/lzo-kmod/lzo1x_compress.o
CC [M] /root/compcache-0.5.1/sub-projects/allocators/xvmalloc-kmod/xvmalloc.o
CC [M] /root/compcache-0.5.1/compcache.o
/root/compcache-0.5.1/compcache.c:150: warning: ‘compcache_prepare_discard’ defined but not used
Building modules, stage 2.
MODPOST 4 modules
CC /root/compcache-0.5.1/compcache.mod.o
LD [M] /root/compcache-0.5.1/compcache.ko
CC /root/compcache-0.5.1/sub-projects/allocators/xvmalloc-kmod/xvmalloc.mod.o
LD [M] /root/compcache-0.5.1/sub-projects/allocators/xvmalloc-kmod/xvmalloc.ko
CC /root/compcache-0.5.1/sub-projects/compression/lzo-kmod/lzo1x_compress.mod.o
LD [M] /root/compcache-0.5.1/sub-projects/compression/lzo-kmod/lzo1x_compress.ko
CC /root/compcache-0.5.1/sub-projects/compression/lzo-kmod/lzo1x_decompress.mod.o
LD [M] /root/compcache-0.5.1/sub-projects/compression/lzo-kmod/lzo1x_decompress.ko
make[1]: Leaving directory `/usr/src/linux-2.6.27.7-9'
linux-q50o:~/compcache-0.5.1 # ./use_compcache.sh
compcache size not given. Using default (25% of RAM).
Setting compcache size to ~121 MB ...
Loading modules ...
Setting up swap device ...
Done!
linux-q50o:~/compcache-0.5.1 # dmesg | tail -2
compcache: Compressed swap size set to: 124176 KB
Adding 124172k swap on /dev/ramzswap0. Priority:100 extents:1 across:124172k
So it should work also on the EFIKA.

The diff I used and works:
Code:
linux-q50o:~/compcache-0.5.1 # diff compcache.c~ compcache.c
454,458c454,458
< #ifdef SWAP_DISCARD_SUPPORTED
< queue_flag_set_unlocked(QUEUE_FLAG_NONROT, compcache.disk->queue);
< blk_queue_set_discard(compcache.disk->queue,
< compcache_prepare_discard);
< #endif
---
> //#ifdef SWAP_DISCARD_SUPPORTED
> // queue_flag_set_unlocked(QUEUE_FLAG_NONROT, compcache.disk->queue);
> // blk_queue_set_discard(compcache.disk->queue,
> // compcache_prepare_discard);
> //#endif
But I'm quite sure, it is not a proper one :)

_________________
CzP
http://czanik.blogs.balabit.com/


Top
   
 Post subject:
PostPosted: Wed Jan 28, 2009 10:49 am 
Offline

Joined: Thu Jul 28, 2005 12:41 am
Posts: 1066
OK, loaded on the EFIKA, and it still works :-)
Code:
linux-bnkx:~/compcache-0.5.1 # ./use_compcache.sh 131072
Setting compcache size to ~128 MB ...
Loading modules ...
Setting up swap device ...
Done!
linux-bnkx:~/compcache-0.5.1 # dmesg | tail -2
compcache: Compressed swap size set to: 131072 KB
Adding 131068k swap on /dev/ramzswap0. Priority:100 extents:1 across:131068k

_________________
CzP
http://czanik.blogs.balabit.com/


Top
   
 Post subject:
PostPosted: Wed Jan 28, 2009 12:18 pm 
Offline
Site Admin

Joined: Fri Sep 24, 2004 1:39 am
Posts: 1589
Location: Austin, TX
Quote:
OK, loaded on the EFIKA, and it still works :-)
Code:
linux-bnkx:~/compcache-0.5.1 # ./use_compcache.sh 131072
Setting compcache size to ~128 MB ...
Loading modules ...
Setting up swap device ...
Done!
linux-bnkx:~/compcache-0.5.1 # dmesg | tail -2
compcache: Compressed swap size set to: 131072 KB
Adding 131068k swap on /dev/ramzswap0. Priority:100 extents:1 across:131068k
Does it run GNOME or KDE? :)

I got very decent performance out of Xfce/Firefox.

As for the diff;
Code:
queue_flag_set_unlocked(QUEUE_FLAG_NONROT, compcache.disk->queue);
This is the ONLY line you need to remove. This is the correct diff;
Code:
--- compcache.c.orig 2009-01-28 12:14:22.000000000 -0600
+++ compcache.c 2009-01-28 12:14:56.000000000 -0600
@@ -452,7 +452,9 @@ static int __init compcache_init(void)
blk_queue_make_request(compcache.disk->queue, compcache_make_request);

#ifdef SWAP_DISCARD_SUPPORTED
+#ifdef QUEUE_FLAG_NONROT
queue_flag_set_unlocked(QUEUE_FLAG_NONROT, compcache.disk->queue);
+#endif
blk_queue_set_discard(compcache.disk->queue,
compcache_prepare_discard);
#endif

_________________
Matt Sealey


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 10 posts ] 

All times are UTC-06:00


Who is online

Users browsing this forum: No registered users and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
PowerDeveloper.org: Copyright © 2004-2012, Genesi USA, Inc. The Power Architecture and Power.org wordmarks and the Power and Power.org logos and related marks are trademarks and service marks licensed by Power.org.
All other names and trademarks used are property of their respective owners. Privacy Policy
Powered by phpBB® Forum Software © phpBB Group