maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [announce] swappolube to lubricate your gui (https://talk.maemo.org/showthread.php?t=62312)

slender 2010-09-16 08:09

Re: [announce] swappolube to lubricate your gui
 
Oh facepalm
"swapoff/swapon/swapoff via a temporary swapfile"
Thatīs why I could not swapoff. Stupid me!

Bingley Joe 2010-09-16 12:56

Re: [announce] swappolube to lubricate your gui
 
Quote:

Originally Posted by debernardis (Post 817524)
Concerning this issue, I want to implement the small memory-freeing command that Simon describes in his blog post, saying he runs it as a cron job.

Code:

I run a cronjob that drops buffer cache containing pagecache, dentries and inodes, to clear out unused dirty pages (sync; echo 3 > /proc/sys/vm/drop_caches).
This might take some time and resources to run, since there's a sync command which writes down to the flash memory.
Given that we haven't cron by default on our devices, and I don't know how to mess with the alarmd daemon (and I'm not sure I'll ever do), I would then add an icon to run the command and free memory when the user likes to, i.e. when the device isn't going to do critical things like answering a call or shooting a video.

What do you think? Button or alarmd?

I definitely like the idea of a button if I have to choose one, but I can see both being the most useful :p

P@t 2010-09-16 13:27

Re: [announce] swappolube to lubricate your gui
 
Adding my thanks too

But I have noticed that at least some of the parameters do not survive a reboot?! While it seems that it should.

kaos_king 2010-09-16 14:10

Re: [announce] swappolube to lubricate your gui
 
This certainly seems to have speeded things up.

Not rebooted as of yet though.

debernardis 2010-09-16 14:15

Re: [announce] swappolube to lubricate your gui
 
Quote:

Originally Posted by P@t (Post 817878)
Adding my thanks too

But I have noticed that at least some of the parameters do not survive a reboot?! While it seems that it should.

Please control that it has installed a /etc/event.d/tuning file

gazza_d 2010-09-16 14:20

Re: [announce] swappolube to lubricate your gui
 
Quote:

Originally Posted by debernardis;817524
Concerning this issue, I want to implement the small memory-freeing command that Simon describes in his blog post, saying he runs it as a cron job.

[code
I run a cronjob that drops buffer cache containing pagecache, dentries and inodes, to clear out unused dirty pages (sync; echo 3 > /proc/sys/vm/drop_caches).[/code]

This might take some time and resources to run, since there's a sync command which writes down to the flash memory.
Given that we haven't cron by default on our devices, and I don't know how to mess with the alarmd daemon (and I'm not sure I'll ever do), I would then add an icon to run the command and free memory when the user likes to, i.e. when the device isn't going to do critical things like answering a call or shooting a video.

What do you think? Button or alarmd?

I'm greedy, and would like to see both! The ability to have a "garbage collector" running automatically would be great.

Would an good idea be to spin this off and merge with the optimizeN900 thread.

There does seem to be a multitude of different threads each offering different parts of the jigsaw which is N900 optimisation.

P@t 2010-09-16 14:29

Re: [announce] swappolube to lubricate your gui
 
Quote:

Originally Posted by debernardis (Post 817914)
Please control that it has installed a /etc/event.d/tuning file

I have the file 'tuning' and I can read the same values as in your first post.
However when I reboot, I can read for example:
40 for for the parameter dirty_ratio
while it should be 95

If I launch again the DEB, then the parameters turn to be at the correct values.

PS: some weeks ago I had modified the rcS file and did change the parameters of swappiness and page-cluster directly in the file. Could that be related? (I have serious doubt but...)

kaos_king 2010-09-16 14:40

Re: [announce] swappolube to lubricate your gui
 
Quote:

Originally Posted by P@t (Post 817925)
I have the file 'tuning' and I can read the same values as in your first post.
However when I reboot, I can read for example:
40 for for the parameter dirty_ratio
while it should be 95

If I launch again the DEB, then the parameters turn to be at the correct values.

PS: some weeks ago I had modified the rcS file and did change the parameters of swappiness and page-cluster directly in the file. Could that be related? (I have serious doubt but...)

I can confirm this too, and it doesnt seem to matter what method reboot is used it always resets. Ive not tested any other figures than the dirty_ratio one as im at work (and supposed to be doing just that).

I doubt you manually changing the swappiness and page cluster made a difference, as I never have changed them and im getting it. I'd expect everyone would be the same?

debernardis 2010-09-16 14:43

Re: [announce] swappolube to lubricate your gui
 
@P@t: you're right. Both dirty_ratio and dirty_background_ratio don't get saved. I'm going to try to see why :)

kaos_king 2010-09-16 14:48

Re: [announce] swappolube to lubricate your gui
 
Quote:

Originally Posted by debernardis (Post 817940)
@P@t: you're right. Both dirty_ratio and dirty_background_ratio don't get saved. I'm going to try to see why :)

Thanks for packaging it together. Really does seem snappier, and that was before I OC'd it after a reboot. It was so snappy, i thought i HAD OC'd it!

Would be good to get it to survive a reboot :D

debernardis 2010-09-16 14:57

Re: [announce] swappolube to lubricate your gui
 
OK, it can be corrected by letting the script start later. If you don't wont to wait for the next version, just edit as root /etc/event.d/tuning and change the start on rcSlate line into
Code:

start on started hildon-desktop
This will make it remember the changes after booting.

les_garten 2010-09-16 15:21

Re: [announce] swappolube to lubricate your gui
 
Quote:

Originally Posted by debernardis (Post 817524)
@f2thak: sorry mate. Hope you have the flasher utility at hand, or you had backupmenu to restore the pristine state. Might be that when turning it off, it hadn't written everything on flash, due to the changes in the way read and write get managed? So, maybe it's better to issue a sync before turning off?

@Frank Banul: reboot is not needed, the parameter changes are made on-the-fly during the install of the script that makes them also applied at boot time. And, they are reverted at uninstall time, when that script gets erased.

@kennibal: yes, and if you read Simon's explanation of those params, you'll find that there is one that lets silently crash the latest program you start if it elicits an out-of-memory condition, instead of getting rid of one or more background processes. It's the price to pay for the fluidity. If you try again maybe it will start correctly after a cleanup of memory.

Concerning this issue, I want to implement the small memory-freeing command that Simon describes in his blog post, saying he runs it as a cron job.

Code:

I run a cronjob that drops buffer cache containing pagecache, dentries and inodes, to clear out unused dirty pages (sync; echo 3 > /proc/sys/vm/drop_caches).
This might take some time and resources to run, since there's a sync command which writes down to the flash memory.
Given that we haven't cron by default on our devices, and I don't know how to mess with the alarmd daemon (and I'm not sure I'll ever do), I would then add an icon to run the command and free memory when the user likes to, i.e. when the device isn't going to do critical things like answering a call or shooting a video.

What do you think? Button or alarmd?

How often is this cron job ran? I don't know who Simon is and therefore don't know his blog. I'd like to add this to my cron jobs.

v13 2010-09-16 15:23

Re: [announce] swappolube to lubricate your gui
 
Quote:

Originally Posted by debernardis (Post 816676)
Code:

echo "0" > /proc/sys/net/ipv4/tcp_timestamps

Turning off TCP timestamps is a bad bad thing. By turning off timestamps you'll have bad RTT estimation which means bad retransmission timeout calculation. This will result in poor performance especially on conditions where there are frequent packet losses, which is the case of most 3G connections.

debernardis 2010-09-16 16:12

Re: [announce] swappolube to lubricate your gui
 
@v13: Thanks. Now, what I'd like is knowing the pros and cons of each parameter, and having a gui to turn them on/off or set their value - and save groups of them as profiles.
It's out of my skills but maybe someone will be interested to code it.

Quote:

Originally Posted by les_garten (Post 817975)
How often is this cron job ran? I don't know who Simon is and therefore don't know his blog. I'd like to add this to my cron jobs.

You'll find the link to Simon's blog in the first post of this thread. I asked him how often too, and I'm still waiting for his answer. In the meantime I think I'll make a button for that.

debernardis 2010-09-16 17:08

Re: [announce] swappolube to lubricate your gui
 
I've attached a new version 0.1-maemo1 which corrects the problem found by p@t concerning the permanence of some parameters

shadowjk 2010-09-16 20:16

Re: [announce] swappolube to lubricate your gui
 
Dropping caches sounds like a silly idea too. It's mostly only useful for running disk benchmarks when you want to make sure stuff takes the slow path from permanent storage rather than coming from the fast ram..

hawaii 2010-09-17 02:36

Re: [announce] swappolube to lubricate your gui
 
Hi.

I'm Simon. I wrote the article. I did receive your question - but I've been extremely busy with Nokia World and my birthday this week. I've just arrived back in Canada and I'll be sure to provide an updated post concerning all the questions that have been posted here.

Thanks guys.

Sorry I didn't get back to your comments or questions on the blog or via email. I'll be honest, it's much faster to reach me on Twitter.

te37v 2010-09-17 03:28

Re: [announce] swappolube to lubricate your gui
 
Happy Birthday!

WhiteWolf 2010-09-17 07:59

Re: [announce] swappolube to lubricate your gui
 
Happy Birthday! :D

pixel8 2010-09-17 12:28

Re: [announce] swappolube to lubricate your gui
 
great tweak! kudos to you debernardis.

happy birthday to you Hawaii

jorjino 2010-09-17 13:41

Re: [announce] swappolube to lubricate your gui
 
HAPPY BIRTHDAY HAWAII !!!
And all the best to you!
;-)))

fms 2010-09-17 16:45

Re: [announce] swappolube to lubricate your gui
 
Quote:

echo "0" > /proc/sys/vm/page-cluster
Please, correct me if I am wrong, but I doubt this one makes sense, as flash memory appears to be written in 256kB pages. So, the original number of 5 that translates into 32*4096=128kB makes more sense. You may even increase it to 6!

shadowjk 2010-09-17 16:56

Re: [announce] swappolube to lubricate your gui
 
Yes, 0 makes no sense, alot of the other various stuff I've seen here and there makes no sense either, but the placebo effect seems to override new slowdowns anyway... :)

debernardis 2010-09-17 17:54

Re: [announce] swappolube to lubricate your gui
 
So we should see which of the parameters are really useful and which ones are neutral or dangerous... By now tcp_timestamps and page-cluster are considered guilty.
Can you suggest some kind of benchmark to evaluate if pulling them out of the script can make a difference.

Or, what about a double-blind cross-over scheme for an in-vivo experiment? Where a number of volunteers load in blind 3 or 4 different parameter schemes, in a latin square order, and evaluates the effect on an analog visual scale, and then we get the data and make the stats? :)

fms 2010-09-17 17:58

Re: [announce] swappolube to lubricate your gui
 
Quote:

Originally Posted by shadowjk (Post 819074)
Yes, 0 makes no sense, alot of the other various stuff I've seen here and there makes no sense either, but the placebo effect seems to override new slowdowns anyway... :)

I really really think someone should try and package COMPCACHE for the N900. It may make a huge difference, by providing fast intermediate swap area in RAM (where swapped out pages are stored in gzipped form).

fms 2010-09-17 18:01

Re: [announce] swappolube to lubricate your gui
 
Quote:

Originally Posted by debernardis (Post 819136)
So we should see which of the parameters are really useful and which ones are neutral or dangerous... By now tcp_timestamps and page-cluster are considered guilty.

I know for sure that the swappiness thing helps. You can test it by running Fennec or any other memory hogging application. The kill_oob_* thing looks sane, and so does the laptop_mode (based on its description found with Google). The tcp_* stuff is petty and probably does not make any difference to the network performance (unless somebody proves otherwise). Can't say much about the rest.

etuoyo 2010-09-17 18:07

Re: [announce] swappolube to lubricate your gui
 
Will surely try this out once I get my n900 back

shadowjk 2010-09-17 18:17

Re: [announce] swappolube to lubricate your gui
 
What does setting dirty_*expire* to 0 do? Well either way if 0 means immediately it's kinda bad for same reason as setting page-cluster to 0, you want data to have a chance to accumulate before it gets written. Not that good if it means "never" either, data loss would happen everytime you have an unexpected shutdown..

TiagoTiago 2010-09-17 18:29

Re: [announce] swappolube to lubricate your gui
 
i also wanna know the pros and cons of each change please, also, a GUI for toggling each parameter individually would be great.

Btw, why you don't put this on -devel?

debernardis 2010-09-17 18:37

Re: [announce] swappolube to lubricate your gui
 
Quote:

Originally Posted by TiagoTiago (Post 819158)
i also wanna know the pros and cons of each change please, also, a GUI for toggling each parameter individually would be great.

Btw, why you don't put this on -devel?

This has a very easy answer: because before I learn enough Python and/or Qt to make a GUI app - or before I'm proficient enough in those kernel parameters - well the N900 will be in the Nokia Espoo museum as the first of 150 Meego devices already out :cool:
Seriously, guys: I just packed the thing in a deb because it made my n900 so pleasant to use and I wished to share it. Can't do much more :D

But, I like the idea of the double-blind cross-over experiment. Anybody willing to volunteer?

egoshin 2010-09-17 18:52

Re: [announce] swappolube to lubricate your gui
 
Quote:

Originally Posted by fms (Post 819066)
Please, correct me if I am wrong, but I doubt this one makes sense, as flash memory appears to be written in 256kB pages. So, the original number of 5 that translates into 32*4096=128kB makes more sense. You may even increase it to 6!

I just repeat myself (I posted it somewhere near swapiness thread) -

The flash block size is 128KBytes typical. That means - if you write a smaller block it is possible that hardware READS 128KB before, replace your small portion and write back. In this case it has a big sense to write by N * 128KB blocks to eliminate reads.

However, if you write sequentially, a smart hardware may have some buffering and it may determine that your next write is in the same 128KB block and combine it. In this case a size of page cluster less 128KB may have sense because it allows kernel interrupt page write operation and it accelerates a device reaction.

Unfortunately, I don't know - is eMMC hardware smart enough.

egoshin 2010-09-17 18:55

Re: [announce] swappolube to lubricate your gui
 
Quote:

Originally Posted by fms (Post 819138)
I really really think someone should try and package COMPCACHE for the N900. It may make a huge difference, by providing fast intermediate swap area in RAM (where swapped out pages are stored in gzipped form).

It would have a big impact on battery life (1) because CPU usage, and it decreases an available RAM space which is very valuable for N900 Maemo (2). So, it would decrease N900 performance.

But your mileage varies - test yourself.

atilla 2010-09-17 19:00

Re: [announce] swappolube to lubricate your gui
 
for me it works great too.
everything seems much more responsive.
850mhz,mohammads hildon package your swappiness package....
damn my phone is a beast!!
i love you guys.
thanks for your work

lvlonkey 2010-09-17 19:07

Re: [announce] swappolube to lubricate your gui
 
sounds interesting but ill hold off until yall figure all the possible kinks out.

arora.rohan 2010-09-17 19:09

Re: [announce] swappolube to lubricate your gui
 
This script is amazing...
Just amazing..
look at this...
http://i51.tinypic.com/ac4ayf.png

its been 24 hours since i charged this phone.. Amazing script!!! Amazing work!
850mhz Lv ,mohammads hildon package , this swappiness package

maartenmk 2010-09-17 19:10

Re: [announce] swappolube to lubricate your gui
 
Quote:

Originally Posted by fms (Post 819139)
I know for sure that the swappiness thing helps. You can test it by running Fennec or any other memory hogging application. The kill_oob_* thing looks sane, and so does the laptop_mode (based on its description found with Google). The tcp_* stuff is petty and probably does not make any difference to the network performance (unless somebody proves otherwise). Can't say much about the rest.

I do know that swappiness is not the only thing that helps. I had just that modified first and couldn't notice a big difference, but running this script I most certainly can! (shadowjk, if you think this is placebo effect you probably haven't tried it yet)
The two variables that weren't permanent before are questionable. I didn't notice they didn't stick.

RogerTHAcctant 2010-09-17 19:23

Re: [announce] swappolube to lubricate your gui
 
great optimizations, its way smoother now, thanks!!

fms 2010-09-17 19:34

Re: [announce] swappolube to lubricate your gui
 
Quote:

Originally Posted by egoshin (Post 819175)
It would have a big impact on battery life (1) because CPU usage, and it decreases an available RAM space which is very valuable for N900 Maemo (2). So, it would decrease N900 performance.

Not necessarily. Given how expensive MMC access operations are, gzipping most pages to, let us say, 16MB of RAM may well prove to be faster than pushing the same pages to the MMC.

slender 2010-09-17 19:54

Re: [announce] swappolube to lubricate your gui
 
Btw
http://www.csn.ul.ie/~mel/docs/vm/
http://www.informit.com/store/produc...bn=0131453483#

egoshin 2010-09-17 20:03

Re: [announce] swappolube to lubricate your gui
 
Quote:

Originally Posted by fms (Post 819196)
Not necessarily. Given how expensive MMC access operations are, gzipping most pages to, let us say, 16MB of RAM may well prove to be faster than pushing the same pages to the MMC.

I run root FS from /home partition - move root FS from UBIFS which is a compressed file system and I see the battery time increase and also - don't see any significant impact on performance.

So, I guess, a compression of swap space may be not a good thing on N900.


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

vBulletin® Version 3.8.8