Notices


Reply
Thread Tools
Posts: 2,802 | Thanked: 4,491 times | Joined on Nov 2007
#101
Originally Posted by locusf View Post
I know about the lower priority on the swap, there really is no fix to it, since swapon on Diablo doesn't have the priority switch.
BTW, that's fixable, and I'm thinking of adding it to the community SSU. Here's a ramzez-init modification to handle both cases (as well as getting rid of a (harmless) "sh: : unknown operand" error when disksize isn't set in GConf, and simplifying the insmod logic a bit):

Code:
--- ramzez-init.orig	2010-08-19 17:06:20.000000000 +0100
+++ ramzez-init	2010-08-19 17:34:59.000000000 +0100
@@ -18,14 +18,12 @@
   start)
   	echo "Inserting kernel modules!"
   	DISKSIZE_KB=$(gconftool-2 -g /apps/ramzez/disksize)
+  	DISKSIZE_KB=${DISKSIZE_KB:-$DISKSIZE_DEFAULT}
 	insmod /usr/share/ramzez/xvmalloc.ko
-	if [[ $DISKSIZE_KB != '' ]]; then
-		insmod /usr/share/ramzez/ramzswap.ko disksize_kb=$DISKSIZE_KB
-	else
-		insmod /usr/share/ramzez/ramzswap.ko disksize_kb=$DISKSIZE_DEFAULT
-	fi
+	insmod /usr/share/ramzez/ramzswap.ko disksize_kb=$DISKSIZE_KB
 	sleep 1
-	swapon /dev/ramzswap0	
+	swapon -h 2>&1 | grep -qe "-p" && PRI="-p 1"
+	swapon $PRI /dev/ramzswap0	
 	;;
   stop)
   	echo "Removing kernel modules!"

Also: package ramzez_0.3_diablo_armel.deb seems to be missing /usr/bin/ramzez :-(

Last edited by lma; 2010-08-19 at 16:50.
 
Posts: 1,101 | Thanked: 1,184 times | Joined on Aug 2008 @ Spain
#102
Originally Posted by lma View Post
BTW, that's fixable, and I'm thinking of adding it to the community SSU. Here's a ramzez-init modification to handle both cases (as well as getting rid of a (harmless) "sh: : unknown operand" error when disksize isn't set in GConf, and simplifying the insmod logic a bit):
Your modification doesn't work because swapon is busybox.
This works, it's already included in the diablo-tweaks package, in the "diabloturbo" thread.
Code:
--- ramzez-init 2009-10-02 12:45:40.000000000 +0200
+++ /etc/init.d/ramzez-init     2010-07-24 15:22:01.000000000 +0200
@@ -19,17 +19,21 @@
        echo "Inserting kernel modules!"
        DISKSIZE_KB=$(gconftool-2 -g /apps/ramzez/disksize)
        insmod /usr/share/ramzez/xvmalloc.ko
-       if [[ $DISKSIZE_KB != '' ]]; then
+       if [[ "$DISKSIZE_KB" != "" ]]; then
                insmod /usr/share/ramzez/ramzswap.ko disksize_kb=$DISKSIZE_KB        else
                insmod /usr/share/ramzez/ramzswap.ko disksize_kb=$DISKSIZE_DEFAULT
        fi
        sleep 1
-       swapon /dev/ramzswap0
+       /sbin/swapon /dev/ramzswap0
+       for i in $(grep -v ramzswap /proc/swaps|grep -v Filename|cut -d " " -f 1); do
+               /sbin/swapoff "$i"
+               /sbin/swapon "$i"
+       done
        ;;
   stop)
        echo "Removing kernel modules!"
-       swapoff /dev/ramzswap0
+       /sbin/swapoff /dev/ramzswap0
        rmmod ramzswap
        rmmod xvmalloc
        ;;
 
Posts: 2,802 | Thanked: 4,491 times | Joined on Nov 2007
#103
Originally Posted by maacruz View Post
Your modification doesn't work because swapon is busybox.
Yeah, it assumes a patched busybox for priority handling, otherwise falls back to current behaviour. The patch I linked to isn't quite complete (it assumes some intermediate changes and doesn't update the "trivial" usage message) but I've already got it working here.

This works, it's already included in the diablo-tweaks package, in the "diabloturbo" thread.
Code:
+       for i in $(grep -v ramzswap /proc/swaps|grep -v Filename|cut -d " " -f 1); do
+               /sbin/swapoff "$i"
+               /sbin/swapon "$i"
+       done
This is fine at boot time, but you may not be able to swapoff if the tablet's been running a while :-(

BTW, anyone know what is required kernel-wise to get a more recent compcache on Diablo? Is it worth pursuing?
 
Posts: 2,802 | Thanked: 4,491 times | Joined on Nov 2007
#104
Ok, so I've been dogfooding this full-time for a couple of weeks and I can't overstate how much more useable it makes the tablet!

After some experimentation I settled on loading ramzswap.ko with "disksize_kb=131072 memlimit_kb=32768", which allows me to run everything in the attached screenshot without even touching the flash-based swapfile (which I might as well get rid of at this point):

Code:
Nokia-N810-43-7:~# cat /proc/swaps 
Filename				Type		Size	Used	Priority
/dev/ramzswap0                          partition	131068	96608	10
/media/mmc2/.swap                       file		131064	0	-4
Code:
Nokia-N810-43-7:~# free
              total         used         free       shared      buffers
  Mem:       126796       124500         2296            0            8
 Swap:       262132        96608       165524
Total:       388928       221108       167820
Code:
Nokia-N810-43-7:~# cat /proc/ramzswap 
DiskSize:	  131072 kB
NumReads:	   15263
NumWrites:	   25807
FailedReads:	       0
FailedWrites:	       0
InvalidIO:	       0
PagesDiscard:	       0
ZeroPages:	    2980
GoodCompress:	      75 %
NoCompress:	       5 %
PagesStored:	   21465
PagesUsed:	    6976
OrigDataSize:	   85860 kB
ComprDataSize:	   27692 kB
MemUsedTotal:	   27904 kB
I really want to get this (or at least support for it) in the community SSU. So far I've added swapon -p support to busybox and the "swap notify" patch to the kernel, do ping me if there's anything else that would help.
Attached Images
 
 

The Following 3 Users Say Thank You to lma For This Useful Post:
Posts: 138 | Thanked: 8 times | Joined on Dec 2009
#105
cant seem to find ramzez on extras-devel and i dont think the latest version is on the garage page either. Anyone know where i can find it?
 
Posts: 2,802 | Thanked: 4,491 times | Joined on Nov 2007
#106
Based on posts #82 - #86, 0.3 is the latest stable version.
 
tso's Avatar
Posts: 4,783 | Thanked: 1,253 times | Joined on Aug 2007 @ norway
#107
So basically you have the whole ram set aside as compressed swap, lma?
__________________
Be warned, posts are often line of thoughts at highway speeds...
 
Posts: 2,802 | Thanked: 4,491 times | Joined on Nov 2007
#108
Originally Posted by tso View Post
So basically you have the whole ram set aside as compressed swap, lma?
No, only up to 32MiB (memlimit_kb option, actual usage reported as MemUsedTotal in /proc/ramzswap) which can hold up to 128MiB before compression (disksize_kb, actual size is what is reported by free or /proc/swaps).

In the above snapshot the tradeoff is 27904KiB physical RAM for 96608Kib virtual memory, ie a net gain of around 67MiB without having to use slow flash.

http://code.google.com/p/compcache/wiki/StatsExplained has some more details / discussion.
 

The Following User Says Thank You to lma For This Useful Post:
tso's Avatar
Posts: 4,783 | Thanked: 1,253 times | Joined on Aug 2007 @ norway
#109
Sure wish the ui tool had more fine-tunable settings.

Ah, now i see. The reported space is what ramzez will try to store in total, by using compression to make it fit within the actually allocated space.
__________________
Be warned, posts are often line of thoughts at highway speeds...

Last edited by tso; 2010-08-31 at 18:39.
 
Posts: 42 | Thanked: 27 times | Joined on Jun 2010
#110
Hi guys,

is there any news about compcache on n900? I would really like to see this on my n900.

Thanks for any information.
 
Reply


 
Forum Jump


All times are GMT. The time now is 17:01.