maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   [ANNOUNCE] COMPCACHE on kernel-power (now with notifications) (https://talk.maemo.org/showthread.php?t=76112)

freemangordon 2011-08-27 14:13

[ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
3 Attachment(s)
Since version 49 compcache (ramzswap) is a part of kernel-power, the instructions bellow are not needed and shall be used just as a reference

Here is how to make compcache working on n900. You will need scratchbox or madde environment ready for kernel compilation

1. download latest (48) kernel power source in directory of your choice
apt-get source kernel-power

2. unzip and copy attached patches (update_mmu_cache_arm.zip and patch_swap_notify_core_support_2_2.6.28.zip) into kernel-power-2.6.28\debian\patches

3.add update_mmu_cache_arm.diff at the end of series file

cd kernel-power-2.6.28/debian/patches/
echo update_mmu_cache_arm.diff >> series


4.add patch_swap_notify_core_support_2_2.6.28.diff at the end of series file

cd kernel-power-2.6.28/debian/patches/
echo patch_swap_notify_core_support_2_2.6.28.diff >> series


4. goto kernel source directory and build kernel package
dpkg-buildpackage -rfakeroot -b

5. unzip compcache source(compcache-0.6.2.zip) into the same directory you've downloaded kernel sources

6. cd into compcache-0.6.2 and make it

at that point you should have patched kernel .debs and ramzswap.ko for that kernel. Install kernel on the device and copy ramzswap.ko in /lib/modules/2.6.28.10-power48

reboot and use instructions here
in short it is something like

insmod /lib/modules/current/ramzswap.ko disksize_kb=65536
swapon /dev/ramzswap0
swapoff /dev/mmcblk0p3; swapon /dev/mmcblk0p3



Notifications are working, but seems there are paths in the kernel swap subsystem allowing direct write over a page without first marking it free.
Seems like memory consumption should not be affected by that.

I've disabled nokia swap page remapping (for performance reasons), will enable it again if swap fragmentation develops over time to see if it could help.


EDIT: changed recommended disksize_kb to 120512

jormartr 2011-08-27 14:50

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
Is there any other way for people who can not compile for any other reason? Any precompiled debs, tars or anything?

Thank you, really.

freemangordon 2011-08-27 14:53

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
Quote:

Originally Posted by jormartr (Post 1077492)
Is there any other way for people who can not compile for any other reason? Any precompiled debs, tars or anything?

Thank you, really.

kernel debs are too big to be attached here. if you advice on where to upload them i will

neboja 2011-08-27 15:13

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
ok... i'm kinda idiot for this things, but i googled a little bit, so i saw what compcashe is... but, for what is benefit for us? and is it necessary for me to have it?

freemangordon 2011-08-27 15:22

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
Quote:

Originally Posted by neboja (Post 1077501)
ok... i'm kinda idiot for this things, but i googled a little bit, so i saw what compcashe is... but, for what is benefit for us? and is it necessary for me to have it?

One of the major hardware limitations n900 has is the amount of RAM. Compcache uses part of this RAM to provide swap space which is expected to be twice as big as the RAM used. i.e. for 128MB swap expected usage is about 50-70 MB. so we win about 60 MB of swap which is extremely fast compared to swap on internal flash. So in short this is expected to reduce lagging under memory pressure.

jormartr 2011-08-27 15:23

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
Quote:

Originally Posted by neboja (Post 1077501)
ok... i'm kinda idiot for this things, but i googled a little bit, so i saw what compcashe is... but, for what is benefit for us? and is it necessary for me to have it?

With compcache you use part of your RAM memory as if it was a compressed SWAP file.

This way, when you are out of memory, instead of using a swap on disk, you use a swap on memory, that is faster. Even with having to sacrify ram for swap, and even compress the swap, you still gain speed by not having to access to disk.

And I hope this is what it will happen with this patch.

freemangordon 2011-08-27 15:27

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
Pre-compiled binaries in first post

jormartr 2011-08-27 16:41

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
Omaigaaaaad, nobody comments on this?? The forum and my n900 is about to implosion, finally compcache!!

Haha, joking, I am waiting for some experiences comments, I can not test it myself until middle on next month :/, I really hope this may bring significative improvement.

neboja 2011-08-27 17:32

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
thanks for answers!
so to use it, we must install debs from the first post... right??? or it will be compiled maybe in the next kernel version, so to wait for update??? what do you recommend?
thx for advise ;)

Seker_94 2011-08-27 17:36

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
freemangordon what will this do to our N900 ?

Gusse 2011-08-27 17:38

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
First expression is very positive :)
After short usage, I would say that device is a bit more responsive (my subjective judgement) under heavy load (multiple application running simultaneously).

Thanks for bringing this option to Maemo!

EDIT: After some usage I see problems, device start to lag and eventually does not respond at all, need a reboot.

pantera1989 2011-08-27 17:42

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
Quote:

Originally Posted by Seker_94 (Post 1077606)
freemangordon what will this do to our N900 ?

Hopefully it will make the N900 more responsive or more likely it would take it more time to start lagging. The worst thing that could happen would be frequent random reboots. However a reflash will solve anything. If you are afraid to try it first backup using backupmenu and then try the patch.

So far I am not seeing much difference to be honest..although it hasn't been long.

freemangordon 2011-08-27 18:16

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
Quote:

Originally Posted by pantera1989 (Post 1077610)
Hopefully it will make the N900 more responsive or more likely it would take it more time to start lagging. The worst thing that could happen would be frequent random reboots. However a reflash will solve anything. If you are afraid to try it first backup using backupmenu and then try the patch.

So far I am not seeing much difference to be honest..although it hasn't been long.

Make sure your compcache swap has higher priority than internal flash swap i.e. when cat /proc/swaps ramzswap has higher priority value than mmcblk0p3

mesho123 2011-08-27 18:40

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
what is compcache do ?

it's useful to install ?

ade 2011-08-27 18:43

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
Quote:

Originally Posted by freemangordon (Post 1077618)
Make sure your compcache swap has higher priority than internal flash swap i.e. when cat /proc/swaps ramzswap has higher priority value than mmcblk0p3

Higher priority value meaning closer to zero I guess?
Ramzswap0 was filled first after reboot, so that looks okay.

Curious to see how it's going to behave in terms of cpu/battery costs and performance wise after a period of time...

Code:

cat /proc/swaps
Filename                                Type            Size    Used    Priority
/dev/mmcblk0p3                          partition      786424  57804  -2
/dev/ramzswap0                          partition      131064  130728  -1


evan 2011-08-27 19:05

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
I am installing right now..
should we be more careful with compcache enabled about swappiness value? a value of 100 would make the cpu compressing data all the time?
edit: installed with priorities correct!. testing begins..

moepda 2011-08-27 19:10

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
so once ive installed the .debs and added the .ko , what exactly do i do next ? and how do i do it? sorry for sounding somewhat uninformed :)

Seker_94 2011-08-27 19:17

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
Quote:

Originally Posted by freemangordon (Post 1077618)
Make sure your compcache swap has higher priority than internal flash swap i.e. when cat /proc/swaps ramzswap has higher priority value than mmcblk0p3

and how can we do that ?

Estel 2011-08-27 19:27

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
disable and enable again "regular" swap - as one turned on later, it will have lesser priority.

Another approach is to get swqapon from - for example - debian - it have setting priority ( - p ) working, unlike vanilla maemo swapon.

TMavica 2011-08-27 19:41

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
cat /proc/swaps , i cant find the ramswap drive

mesho123 2011-08-27 19:44

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
what is compcache do ?

it's useful to install ?

TMavica 2011-08-27 19:49

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
After a reboot, the ramzswap0 gone...

karam 2011-08-27 19:55

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
i have been using it for about an hour
personally haven't noticed an improvement with the performance
but the negative side i have noticed
is after using metasploit3
N900 starts to lag so deadly
with out using ramzswap0 it runs normal after using metasploit3

will do more tests anyway

Estel 2011-08-27 20:00

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
Quote:

Originally Posted by TMavica (Post 1077665)
After a reboot, the ramzswap0 gone...

Orly? ;)

Just crete a script, to load it after every boot + manipulate swaps as needed, then place it in event.d folder.

There are *many* threads about it + article(s) in wiki.

evan 2011-08-27 20:03

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
Quote:

Originally Posted by TMavica (Post 1077665)
After a reboot, the ramzswap0 gone...

ofcourse it is. only the default swap partition starts at boot time.
so far with heavy usage it behaves very nicely. looks like a winner to me.

edit: after some time it did become unresponsive. I had to close two microb windows and to wait for a whole minute to respond and close them. all the time I could not even check with terminal or any other way what was using the cpu. when it woke up, i did not reboot and everything was ok again.

freemangordon 2011-08-27 22:08

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
TBH negative feedbacks are somehow expected, as without notifications enabled memory consumption is suboptimal, I will do my best to make them run, but I realy need some help from the guy who has made notifications patch (some guy from BFS kernel developers)

EDIT: btw I would not expect miracles as we are adding only about 60 MB for 128MB swap

freemangordon 2011-08-27 22:20

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
Quote:

Originally Posted by evan (Post 1077641)
I am installing right now..
should we be more careful with compcache enabled about swappiness value? a value of 100 would make the cpu compressing data all the time?
edit: installed with priorities correct!. testing begins..

I am using swapiness 30 and tbh definitely there is improvement when using compcache, have been running it on my primary device for about 8 hours with no single lag.

karam 2011-08-28 00:10

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
ok now this is my final feedback

my first one was negative
reason: lags after metasploit3
how to fix: set up more space for ramzswap0
increasing the internal swap to 1.5gb #not sure if it is important
setting a event.d script to use ramzswap0 directly after the boot
and set up a script using dbus to refresh the ramzswap0 when the device is inactive

------

and after all that i kindda felt a bit faster performance
maybe others will feel more performance
(cause i use speedpatch) which might makes me feel a bit of increased performance


anyway thanks for your effort freemangordon (btw i love half-life *)



//EDIT
even whith the above
when after a period of time
Well N900 gets laggy to death
cat /proc/swap
i can see that the ramzswap0 almost finished

hmm
how much is the max disksize for ramzswap can N900 take?
i tried 200mb ended with an instant reboot

freemangordon 2011-08-28 02:27

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
Quote:

Originally Posted by karam (Post 1077771)
ok now this is my final feedback

my first one was negative
reason: lags after metasploit3
how to fix: set up more space for ramzswap0
increasing the internal swap to 1.5gb #not sure if it is important
setting a event.d script to use ramzswap0 directly after the boot
and set up a script using dbus to refresh the ramzswap0 when the device is inactive

------

and after all that i kindda felt a bit faster performance
maybe others will feel more performance
(cause i use speedpatch) which might makes me feel a bit of increased performance


anyway thanks for your effort freemangordon (btw i love half-life *)



//EDIT
even whith the above
when after a period of time
Well N900 gets laggy to death
cat /proc/swap
i can see that the ramzswap0 almost finished

hmm
how much is the max disksize for ramzswap can N900 take?
i tried 200mb ended with an instant reboot

using more than about 130-140MB of ramzswap is a recipe for a trouble, you will have oom kills for sure

karam 2011-08-28 02:33

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
even if i used 100mb
N900 gets laggy (very much) when the ramzswap is nearly full

i see 20mb does no problems but not sure if any better performance

freemangordon 2011-08-28 03:18

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
Strange, i don't have such problems, seems that not using optimisation scripts with unknown effect is preferable option.

Mohammad 2011-08-28 03:23

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
after esting i had the same problem as karam
when the ramzswap0 gets near to full
n900 starts to lag untill reboot

evan 2011-08-28 06:48

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
second test, same results, after a couple of hours, application web closed. and then everything was stuck.
third test, I reduced ramzsawp to half size and so far so good

edit:
insmod /lib/modules/current/ramzswap.ko disksize_kb=131072
wait a minute. does the n900 have 131mb free even after boot?
and then we momentarily swapoff the default partition,so 131mb have to be real ram. very risky operations.

Quote:

Originally Posted by freemangordon (Post 1077711)
EDIT: btw I would not expect miracles as we are adding only about 60 MB for 128MB swap

are you sure with the above disksize we are not adding double that? is'nt the disksize the ram we are asking and not the target?

Hurrian 2011-08-28 08:33

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
Performance is not quite up to par without ramzswap. It seems that swap notifications are a must!

412b 2011-08-28 12:34

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
Quote:

Originally Posted by evan (Post 1077857)
insmod /lib/modules/current/ramzswap.ko disksize_kb=131072
wait a minute. does the n900 have 131mb free even after boot?
and then we momentarily swapoff the default partition,so 131mb have to be real ram. very risky operations.
are you sure with the above disksize we are not adding double that? is'nt the disksize the ram we are asking and not the target?

"disksize_kb is upper limit on uncompressed worth of data given device can hold. While, memlimit_kb is upper limit on compressed worth of data given device can hold.

I understand that specifying disksize_kb value as upper limit on uncompressed data size seems bit counter-intuitive but this is how it is... We need to present a "fixed-size" disk to kernel." (from the author of compcache).

freemangordon 2011-08-28 12:40

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
Quote:

Originally Posted by Hurrian (Post 1077873)
Performance is not quite up to par without ramzswap. It seems that swap notifications are a must!

Agree, will do my best to make them functional.

Hurrian 2011-08-28 14:27

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
Quote:

Originally Posted by freemangordon (Post 1077991)
Agree, will do my best to make them functional.

Damn, freemangordon! First 720p, now compcache!
Maemo 5 is looking really good. And it's looking better now that we will soon not need to swap on the slow flash ever again.

jormartr 2011-08-28 14:32

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
Swapping on flash won't go away never, but it can improve, I hope.

mesho123 2011-08-28 14:53

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
what is compcache do ?

it's useful to install ?

vi_ 2011-08-28 14:57

Re: [ANNOUNCE] COMPCACHE on kernel-power
 
Quote:

Originally Posted by mesho123 (Post 1078027)
what is compcache do ?

it's useful to install ?

Read the thread idiot.


All times are GMT. The time now is 08:57.

vBulletin® Version 3.8.8