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)

Gusse 2011-08-30 11:18

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
I did comparison between KPv48 and KPv48_Compcache and it seems that RAM and swap usages are both higher with compcache.

What I did: openend microb and did some surfing and monitored Conky. Then left only Conky running and checked RAM and swap after some 5min of idle.

KPv48
RAM: ~170MB
Swap: 90MB

KPv48_Compcache (disksize 98304)
RAM: ~200MB
Swap: 120MB

Wonder why RAM and swap usage is so much higher? I tried to do excatly same things in both cases.

vi_ 2011-08-30 11:26

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
Quote:

Originally Posted by Gusse (Post 1078937)
I did comparison between KPv48 and KPv48_Compcache and it seems that RAM and swap usages are both higher with compcache.

What I did: openend microb and did some surfing and monitored Conky. Then left only Conky running and checked RAM and swap after some 5min of idle.

KPv48
RAM: ~170MB
Swap: 90MB

KPv48_Compcache (disksize 98304)
RAM: ~200MB
Swap: 120MB

Wonder why RAM and swap usage is so much higher? I tried to do excatly same things in both cases.

Swap use is higher...Because you now have less RAM...

I imagine the 'swap settings for high I/O' or whatever that thread was called has more appropriate swap settings than say swappolube defaults.

Reasoning is swappolube optimises for minimal swapping (hence low swappiness) and the 'high I/O' settings optimise for lots of little swaps.

freemangordon 2011-08-30 12:04

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
Quote:

Originally Posted by vi_ (Post 1078940)
Swap use is higher...Because you now have less RAM...

I imagine the 'swap settings for high I/O' or whatever that thread was called has more appropriate swap settings than say swappolube defaults.

Reasoning is swappolube optimises for minimal swapping (hence low swappiness) and the 'high I/O' settings optimise for lots of little swaps.

Exactly, bellow are my settings

Code:

        echo 30 > /proc/sys/vm/swappiness
        echo 0 > /proc/sys/vm/page-cluster
        echo 512 > /sys/block/mmcblk0/queue/nr_requests
        echo 512 > /sys/block/mmcblk1/queue/nr_requests


        echo 0 > /sys/block/mmcblk0/queue/iosched/slice_idle
        echo 0 > /sys/block/mmcblk1/queue/iosched/slice_idle
        echo 32 > /sys/block/mmcblk0/queue/iosched/quantum
        echo 32 > /sys/block/mmcblk1/queue/iosched/quantum
        echo 80 > /sys/block/mmcblk0/queue/iosched/fifo_expire_sync
        echo 80 > /sys/block/mmcblk1/queue/iosched/fifo_expire_sync
        echo 180 > /sys/block/mmcblk0/queue/iosched/fifo_expire_async
        echo 180 > /sys/block/mmcblk1/queue/iosched/fifo_expire_async

... and swap on microsd

Gusse 2011-08-30 13:27

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
Quote:

Originally Posted by vi_ (Post 1078940)
Swap use is higher...Because you now have less RAM...

Of cource, what was I thinking :o

If we run out of RAM, could this cause lack of responsiveness due to heavy swapping activity? Just trying to understand what is causing quite big loading conditions in my system when using Compcache.

F2thaK 2011-08-30 13:43

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
I did the following as root in xterm and got errors

Code:

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

insmod /lib/modules/current/ramzswap.ko disksize_kb=120512 = -1 invalid module format
swapon /dev/ramzswap0 = no such file/dir

freemangordon 2011-08-30 14:09

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
Quote:

Originally Posted by F2thaK (Post 1079010)
I did the following as root in xterm and got errors

Code:

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

insmod /lib/modules/current/ramzswap.ko disksize_kb=120512 = -1 invalid module format
swapon /dev/ramzswap0 = no such file/dir

use the kernel from the first post, ok?

TMavica 2011-08-30 16:20

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
when swap full, phone become laggy

freemangordon 2011-08-30 16:31

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
what disksize_kb are you using. Also do you use some speedpatches?

TMavica 2011-08-30 16:35

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
Quote:

Originally Posted by freemangordon (Post 1079076)
what disksize_kb are you using. Also do you use some speedpatches?

use yours recommend size 120512, speedpatch? I removed

freemangordon 2011-08-30 16:49

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
And you are sure speedpatch uninstalls correctly? No remnants? Anyway we are still trying to discover what are the best settings to be used with compcache.
For now you may try (in xterm as root)

echo 20 > /proc/sys/vm/swappiness
echo 2 > /proc/sys/vm/page-cluster

hoping that other vm settings are stock. if that not help then I can bet you have some remnants from some optimization script that have messed your /proc/sys/vm/ (and who knows what else) values. In case lagging continues would you please do cat /proc/sys/vm/* and copy the result here

TMavica 2011-08-30 17:00

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
ok, I try that setting now, see whether lagging for not
by the way, would you mind make a startup script for that??
thx

freemangordon 2011-08-30 17:11

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
Lets first find which are the best values, making startup script is easy.

And BTW you can try lowering disksize_kb to 98304 if swapinness and page-cluster does not have effect.

TMavica 2011-08-30 17:15

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
Quote:

Originally Posted by freemangordon (Post 1079091)
Lets first find which are the best values, making startup script is easy.

And BTW you can try lowering disksize_kb to 98304 if swapinness and page-cluster does not have effect.

no need test other setting i think....because the laggy is seem solved , thanks!

[DarkGUNMAN] 2011-08-30 17:17

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
Code:

~ $ cat /proc/sys/vm/*
0
70
1600
90
1600
0
1
59326
30000        30001        30002        30003        0        0        0        0
45
32768
198736
-66
98304
-121
131072
1024
32
0
65536
2039
4096
2
0
1
0
50
2
0
0
20
100


[DarkGUNMAN] 2011-08-30 17:22

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
Quote:

Originally Posted by TMavica (Post 1079092)
no need test other setting i think....because the laggy is seem solved , thanks!

Create this file /etc/event.d/compcache

Code:

start on startup

service
console none
script
        insmod /lib/modules/current/ramzswap.ko disksize_kb=120512
        sleep 1
        swapon /dev/ramzswap0
        swapoff /dev/mmcblk0p3
        swapon /dev/mmcblk0p3
        run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteDialog \string:"Compcache loaded." uint32:0 string:OK
end script


TMavica 2011-08-30 17:37

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
after boot up, hanged...

DEL

freemangordon 2011-08-30 17:44

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
Quote:

Originally Posted by [DarkGUNMAN] (Post 1079094)
Code:

~ $ cat /proc/sys/vm/*
0
70
1600
90
1600
0
1
59326
30000        30001        30002        30003        0        0        0        0
45
32768
198736
-66
98304
-121
131072
1024
32
0
65536
2039
4096
2
0
1
0
50
2
0
0
20
100


Thanks,but,but...

WTF is that? Where did you get this settings from?

Realy, you (and others with "optimizations") don't help much with testing compcache using in parallel /proc/sys/vm settings different from stock (excluding swappiness and page-cluster). laptop_mode == 1. And we are testing swap?!?

freemangordon 2011-08-30 18:08

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
Quote:

Originally Posted by TMavica (Post 1079100)
after boot up, hanged...

DEL

Are you still unable to boot?

If you are able may I have your /proc/sys/vm settings please.

TMavica 2011-08-31 05:46

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
everything is fine, no more bad lagging. By the way, here is the result, wonder which I could be set to improve more. I reinstalled the speedpatch, still working fine! swapiness to 20 and page cluster to 2, help a lot

0
10
500
40
500
0
0
59326
30000 30001 30002 30003 0 0 0 0
45
32768
208840
-66
98304
-121
131072
1024
32
0
65536
2039
4096
2
0
0
0
50
2
0
0
20
100

freemangordon 2011-08-31 06:01

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
@TMavica - and do you thing there is an improvement on responsiveness, or things are just the same?

412b 2011-08-31 06:24

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
swapiness = 10
runs smooth enough except switching from task manager to app due to io load 50-75%, managed to open about 5 XTerms, 6 Browser tabs, Contacts, Messaging, FBReader, MediaBox, Modest, RSS, File Browser, Calendar with noticable lag in switching (due to high io load).
I've also got a bit tuned syspart (/usr/share/policy/etc/rx51/syspart.conf)
looking forward getting memory free fully working as it's a big stopper at the moment IMO.

[DarkGUNMAN] 2011-08-31 06:31

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
Ok, swapolube optimisations removed set to stock values.
Speedpatch removed.

Still lagging a bit once cache is full.
Since I'm not exactly knowledgable on this are there any more values I need to correct?

Code:

$ cat /proc/swaps
Filename                                Type                Size        Used        Priority
/dev/ramzswap0                          partition        120504        120492        -1
/dev/mmcblk0p3                          partition        786424        63204        -2
~ $ cat /proc/sys/vm/*
0
10
500
40
500
0
0
59326
30000        30001        30002        30003        0        0        0        0
45
32768
201135
-66
98304
-121
131072
1024
32
0
65536
2039
4096
2
0
0
0
50
2
0
0
20
100


freemangordon 2011-08-31 06:50

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
Quote:

Originally Posted by 412b (Post 1079351)
swapiness = 10
runs smooth enough except switching from task manager to app due to io load 50-75%, managed to open about 5 XTerms, 6 Browser tabs, Contacts, Messaging, FBReader, MediaBox, Modest, RSS, File Browser, Calendar with noticable lag in switching (due to high io load).
I've also got a bit tuned syspart (/usr/share/policy/etc/rx51/syspart.conf)
looking forward getting memory free fully working as it's a big stopper at the moment IMO.

Will you try page-cluster values 0,1,2 to see if there is any difference?

Re memory free - it is working OK, trust me on that. My understanding is that what happens is the best possible scenario, i.e. instead of notification for a page that was just marked as unused it is immediately overwritten. While we have notifications for the pages that are not immediately overwritten.
For sure there are optimizations to be done, if you look at the code there is a mutex used on write operations.

And for the amount of applications you are testing with - try that on your laptop and tell me how it went :p

[DarkGUNMAN] 2011-08-31 07:14

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
Responsiveness MUCH improved with page-cluster set to 0 and swappiness set to 10

TMavica 2011-08-31 08:24

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
Quote:

Originally Posted by freemangordon (Post 1079345)
@TMavica - and do you thing there is an improvement on responsiveness, or things are just the same?

Yes, I feel the responsiveness is improved, but not a lot

gregoranderson 2011-08-31 08:37

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
Intrigued as to how phone-ui is with this added. I'm in the middle of a prepping a reflash to end all reflashes of my phone. Off topic, but so far, the best "feel" gains have been eMMC fully ext3 and swap only on SD card (things like Fapman zip along and I can fuddle with the phone doing other stuff while it's doing it's thing) but the phone-ui still remains a stuttering mess.

Either way, will give this a shot later after work, unless someone has beaten me too it.

Cheers @freemangordon et al, for your continued efforts towards this community and unique piece of hardware :)

freemangordon 2011-08-31 08:54

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
@gregoranderson - I would recommend to wait before trying it a little bit, today I will try to make optimizations to the way swap read/write/free requests are handled, at this point compcache does not bring much improvement, while could lead to laggy system from time to time. The "testing" so far was to prove that it is working at all, without oops and hangs.

vi_ 2011-08-31 20:42

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
Quote:

Originally Posted by gregoranderson (Post 1079399)
Intrigued as to how phone-ui is with this added. I'm in the middle of a prepping a reflash to end all reflashes of my phone. Off topic, but so far, the best "feel" gains have been eMMC fully ext3 and swap only on SD card (things like Fapman zip along and I can fuddle with the phone doing other stuff while it's doing it's thing) but the phone-ui still remains a stuttering mess.

Either way, will give this a shot later after work, unless someone has beaten me too it.

Cheers @freemangordon et al, for your continued efforts towards this community and unique piece of hardware :)

Hey, start a new thread on 'the flash to end all re-flashes', this could lead to some interesting discussion!

freemangordon 2011-09-01 06:20

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
OK guys, my conclusions so far:

1 - compcache works :D
2 - Anything above (lets's say) 64-96 MBs for disksize_kb results in a massive swap trashing at some point in time. Yesterday it was the first time for maybe an year I missed a call because the UI was stuck (because of the swap trashing)
3 - using the above size should not harm , only can improve things, but no wonders. I setup my primary phone that way, so will see how it will progress with time.
4- The only viable option so far to get rid of the UI lag is to move swap on SD card. Even if it is class 2 you forget about lagging.

I don't think I can do much more on that, sorry.

TMavica 2011-09-01 06:39

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
I havent swap on sd card, let me trytry

TMavica 2011-09-01 06:43

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
sorry for disturbance..
how to swap on sd card..cant find the wiki

freemangordon 2011-09-01 06:45

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
Quote:

Originally Posted by TMavica (Post 1079860)
I havent swap on sd card, let me trytry

And you MUST use setting from here.

Anyway, this is going OT

evan 2011-09-01 06:47

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
that was my finding also. not a good idea to grab more than half available physical ram for swapz. you don't want to pass each and every call for ram allocation through the swap mechanism. I have such a low disksize for a frew days now and it works, no lags, no crashes, no wonders.

freemangordon 2011-09-01 07:22

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
Quote:

Originally Posted by evan (Post 1079866)
that was my finding also. not a good idea to grab more than half available physical ram for swapz. you don't want to pass each and every call for ram allocation through the swap mechanism. I have such a low disksize for a frew days now and it works, no lags, no crashes, no wonders.

Did you try with 96MB?

And would you share your other settings:

where is your swap located at
/proc/sys/vm changes
io scheduler changes (if any)

what else?

evan 2011-09-01 07:39

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
I tried with 96mb only for a while and while I did not see heavy lags, I noticed nokia maps to take too long to start. Swappiness to 30 and laptop mode to 0 as is default. Nothing else changed. No magic script nor magic carpets. Swap is the default p3 cause I can’t get bothered to repartition my sd card although since you say it’s the best bet for improved performance I will try it when I find the time.

Estel 2011-09-01 13:20

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
And:

Quote:

Originally Posted by freemangordon
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.

...seems to be impossible to fix, currently?

freemangordon 2011-09-01 13:50

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
Quote:

Originally Posted by Estel (Post 1080006)
And:



...seems to be impossible to fix, currently?

Should be posible, but I don't think we will gain anything but additional overhead. You can check upstream zram, they are not using notifications at all, does not seem to have much negative effect. The problem is that SW running on n900 needs lots of RAM and not having it (because it is used by compcache) leads to constant swapping (swap trash).

Anyway there is definitely improvement from using compcahe, just not so much that was probably expected. Use disksize_kb in range 64MB to 96MB and you will see it.

Estel 2011-09-01 16:25

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
Thanks for all your effort - I've not had any "exaggerated" expectations, and it's already great thing that you've bring it to us. I think it's closest of what we can get, to actual higher RAM amount :)

So, thanks for doing something, that no one else was able/interested to bring us.

TMavica 2011-09-02 05:54

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
Friends, I tried swap on SD:

ramzswap (120504), mmcblk0p3, mmcblk1p2 (796472) with priority 1, 0, 0 and with your setting recommanded, but still sometimes the UI got some laggy.

Moreover, I made a script for bootup, only can swapon ramzswap and mmcblk0p3, mmcblk1p2 cant swapon at bootup
from added a more line here, http://talk.maemo.org/showpost.php?p...8&postcount=95

freemangordon 2011-09-02 06:04

Re: [ANNOUNCE] COMPCACHE on kernel-power (now with notifications)
 
Quote:

Originally Posted by TMavica (Post 1080388)
Friends, I tried swap on SD:

ramzswap (120504), mmcblk0p3, mmcblk1p2 (796472) with priority 1, 0, 0 and with your setting recommanded, but still sometimes the UI got some laggy.

Moreover, I made a script for bootup, only can swapon ramzswap and mmcblk0p3, mmcblk1p2 cant swapon at bootup
from added a more line here, http://talk.maemo.org/showpost.php?p...8&postcount=95

Use only 64-96 MBs for ramzswap. And do not use mmcblk0p3, only SD card swap partition. And just to make sure put /sbin/ in front of swapon/swapoff commands

EDIT: and change first line of your script to "start on started rcS-late"


All times are GMT. The time now is 14:53.

vBulletin® Version 3.8.8