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)

debernardis 2010-09-15 09:19

[announce] swappolube to lubricate your gui
 
1 Attachment(s)
I liked so much the kernel hack described by kaze.daniel, allnameswereout and better explained by Simon that I made a package to test it without messing with a root xterm.

The package changes a number of kernel parameters when installed and adds a script to event.d to make the changes permanent. When removed, the script is deleted and the parameters are reset.

Be careful and test it, I'm no expert and made the package "by hand" with dpkg-deb on my ubuntu box.

Let me know if it destroys your n900 or sends your personal data to some rogue site :D

Also let me know if your n900 gets much snappier after installing it, like mine :cool:

____________________________________

As requested by lcuk ;)

> In the top post for this thread, indicate CLEARLY
> the actions and changes it makes

The package issues the following commands which change the way the kernel handles ram and virtual memory (as far as I can understand, i.e. hardly at all)
Code:

echo "30" > /proc/sys/vm/swappiness       
echo "0" > /proc/sys/vm/page-cluster       
echo "1" > /proc/sys/vm/laptop_mode       
echo "1" > /proc/sys/vm/oom_kill_allocating_task       
echo "0" > /proc/sys/vm/dirty_expire_centisecs       
echo "0" > /proc/sys/vm/dirty_writeback_centisecs     
 echo "60" > /proc/sys/vm/dirty_background_ratio       
echo "95" > /proc/sys/vm/dirty_ratio       
echo "0" > /proc/sys/net/ipv4/tcp_timestamps       
echo "1" > /proc/sys/net/ipv4/tcp_no_metrics_save

> files modified and overwritten etc

No files are harmed by installing this package, and no carbon dioxide is released . It adds a /etc/event.d/tuning script as described in the swappiness thread.

> In the package, add a clear indication
> of its actions in the README and
> potentially a man page and/or
> a backlink back to here so others can
> discover its actions easily.

The package description has links to the relevant posts in the swappiness thread.

In the next version I'll add also a link to this thread and a banner in postinst and postrm, if & when I discover how's done ;)
_________________________

I told you I wasn't an expert! Version 0.1.0-1 was flawed in postinst and didn't erase the /etc/event.d/tuning file after package removal (thanks to Mikkov for reporting).
Latest version, 0.1.2 corrects the problem.

AlMehdi 2010-09-15 09:26

Re: [announce] swappolube to lubricate your gui
 
Do it have a gui or is it hard coded? What are the settings?

debernardis 2010-09-15 09:28

Re: [announce] swappolube to lubricate your gui
 
There's no gui and you won't find any icon. The package only changes some settings like in allnameswereout's http://talk.maemo.org/showpost.php?p...1&postcount=59

jurop88 2010-09-15 10:00

Re: [announce] swappolube to lubricate your gui
 
Hi Ernesto,
just downloaded but it still doesn't install via HAM, it says 'operation not permitted' (operazione non possibile)
It worked via dpkg -i, though
It is incredible how the device feels after have changed swappiness and cluster values...
Cheers and thx for the package (original author already thkd, too)

AlMehdi 2010-09-15 10:10

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

Originally Posted by debernardis (Post 816683)
There's no gui and you won't find any icon. The package only changes some settings like in allnameswereout's http://talk.maemo.org/showpost.php?p...1&postcount=59

Ok, then i already have done it.. so i might not se a difference. It is a good hack though. It works.

raven 2010-09-15 10:20

Re: [announce] swappolube to lubricate your gui
 
Downloaded, successfully installed via file-manager->app-manager.
Works Great :D

mr_xzibit 2010-09-15 10:39

Re: [announce] swappolube to lubricate your gui
 
installed fine. how do know if its working?

debernardis 2010-09-15 10:59

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

Originally Posted by mr_xzibit (Post 816719)
installed fine. how do know if its working?

To confirm it has made its dirty work, you could open a terminal window and give
Code:

cat /proc/sys/vm/swappiness
You should get 30.

It's the first parameter it modifies (from the original 100), so if it's 30 you could be confident that also the others have been changed.

Bingley Joe 2010-09-15 12:51

Re: [announce] swappolube to lubricate your gui
 
This looks like a very handy tweak indeed -- thanks for packaging it :)

Just for the sake of having all potentially useful information in one place about this, could someone post removal instructions (or does it show up in App Man)?

oxpo 2010-09-15 12:57

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

Originally Posted by Bingley Joe (Post 816822)
This looks like a very handy tweak indeed -- thanks for packaging it :)

Just for the sake of having all potentially useful information in one place about this, could someone post removal instructions (or does it show up in App Man)?

It shows up in App Man.

/oxpo

mr_xzibit 2010-09-15 12:59

Re: [announce] swappolube to lubricate your gui
 
it shows in app manager mate.

fw190 2010-09-15 13:20

Re: [announce] swappolube to lubricate your gui
 
Installed it today and testing. Probably it will be hard to see. I've got everything set to 0 i transitioncontrol so everything is fast for now ;)

Bingley Joe 2010-09-15 13:33

Re: [announce] swappolube to lubricate your gui
 
Thanks, all :)

Installed using dpkg -i and this seems to make a really nice difference.

Before I installed it, I began copying a large file to the N900 via wifi, which normally renders the phone basically unusable until it's done (or incredibly unpleasant to use at least).. I noticed this script kick in immediately and the device was almost as snappy as it would be without the file copying. Now that the file-copy is complete, it's quick as hell :)

Nice job!

NokTokDaddy 2010-09-15 16:01

Re: [announce] swappolube to lubricate your gui
 
Definite improvement and no adverse effects noticed so far!

You have my admiration and thanks!

mr_xzibit 2010-09-15 16:07

Re: [announce] swappolube to lubricate your gui
 
so how do you manually change these settings then? my swappiness is at 30! what else has it done?

edit....
just read this from first post. i assume thats what its done!

mr_xzibit 2010-09-15 16:32

Re: [announce] swappolube to lubricate your gui
 
n900 like it shuld of been.

one thing i have noticed. if i have multiple web windows open. before if i jump from one to the other. i would have a white screen for a few secs before the page appeared.. now!!! boom its up! good work

kolos 2010-09-15 16:57

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

Originally Posted by mr_xzibit (Post 816993)
n900 like it shuld of been.

one thing i have noticed. if i have multiple web windows open. before if i jump from one to the other. i would have a white screen for a few secs before the page appeared.. now!!! boom its up! good work

I can confirm this. I experienced the same issue, but now I'm running this settings for 2 days (manually entered in xterminal) and the phone is very responsive. Guys this is really awesome job!

plaban 2010-09-15 17:21

Re: [announce] swappolube to lubricate your gui
 
I'm going to try it :)

lcuk 2010-09-15 17:29

Re: [announce] swappolube to lubricate your gui
 
Great to see hacks and tweaks moving from being command line guru required to being nicely packaged up and reproducible by yourself and others!

However, because this is a package which will not appear to do anything, please do the following:

In the top post for this thread, indicate CLEARLY the actions and changes it makes
files modified and overwritten etc - do not send people to another thread and say "it similar to that over there"

In the package, add a clear indication of its actions in the README and potentially a man page and/or a backlink back to here so others can discover its actions easily.

Thanks for taking that small step beyond hackerdom and making it graspable by normal folks :)

Descalzo 2010-09-15 18:47

Re: [announce] swappolube to lubricate your gui
 
Well so far so good.

clovis86 2010-09-15 19:08

Re: [announce] swappolube to lubricate your gui
 
pfuh
this little things makes it so smooooth :D
thanks again

fred123 2010-09-15 19:14

Re: [announce] swappolube to lubricate your gui
 
Installed OK

Testing with the following apps running
Media Player
sygic MM10 - route demo
email
browser windows
file manager
conky

fast switching between windows
no delay in picking up incoming call

looking good

lcuk 2010-09-15 19:21

Re: [announce] swappolube to lubricate your gui
 
Loud applause :)

Thanks so much debernardis, the minor tweaks to presentation make all the difference.
We should be able to use this thread to show the many hackers out there that their simple tweaks can be wrapped up cleanly ;)



Quote:

Originally Posted by debernardis (Post 816676)
In the next version I'll add also a link to this thread and a banner in postinst and postrm, if & when I discover how's done ;)

Please don't do this part though, imagine how bad it will be if everyone followed suit :eek:

if you *do* want to add something similar, add a small script and .desktop icon which opens the browser to this thread :)
(or similar kind of idea perhaps?)

datjomp 2010-09-15 19:26

Re: [announce] swappolube to lubricate your gui
 
Christine feels smoother with these tweaks :)
Thanks!

gazza_d 2010-09-15 19:28

Re: [announce] swappolube to lubricate your gui
 
Thanks for this deb. This does seem to have improved responsiveness on my 900, although it has been off a couple of times, so I could drop the sim into another phone for a short while.

yamakasi 2010-09-15 19:51

Re: [announce] swappolube to lubricate your gui
 
so this tweak will make the transition effect less jaggier?

Frank Banul 2010-09-15 20:07

Re: [announce] swappolube to lubricate your gui
 
Isn't a reboot required after install? I don't see that in the list of instructions nor does the install suggest that.

Frank

kaze.daniel 2010-09-15 20:20

Re: [announce] swappolube to lubricate your gui
 
well, its been almost a month since I am using that hack, jes created another file to run with the original mod... so long no crashes, only that the cpu ram free memory oscilates a lil bit from high to low when the battery power is vanishing.. anyway, that hack makes the n900 works like a totally different tablet. love that.

rainmaster 2010-09-15 20:36

Re: [announce] swappolube to lubricate your gui
 
would this work with the enhanced kernel?

Chrome 2010-09-15 20:39

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

Originally Posted by rainmaster (Post 817255)
would this work with the enhanced kernel?

I don't see any reason it wouldn't, i'm using kernel-power and it's working fine :)

sony123 2010-09-15 21:49

Re: [announce] swappolube to lubricate your gui
 
Work fine and the UI feels more responsive.

kennibal 2010-09-16 02:41

Re: [announce] swappolube to lubricate your gui
 
Amazing, for the first time, using this swappolube, I can now run my 12 favorite apps without lags! (including media player).

But there was a time when I was switching in Music Player, the app began to crash. Otherwise, the rest of the 11 apps seem to work fine. :)

F2thaK 2010-09-16 02:45

Re: [announce] swappolube to lubricate your gui
 
nice name :D !!!!!!!!!

xiton 2010-09-16 02:53

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

I read somewhere that modifying the page-cluster was a bad idea. Can anyone shed some light on this, and if it's safe?

F2thaK 2010-09-16 02:59

Re: [announce] swappolube to lubricate your gui
 
seems okay........


http://talk.maemo.org/showpost.php?p...8&postcount=28

http://talk.maemo.org/showpost.php?p...0&postcount=61

F2thaK 2010-09-16 04:47

Re: [announce] swappolube to lubricate your gui
 
you killed my phone !!

reboots after bout 3 seconds of booting up -> repeat

debernardis 2010-09-16 05:14

Re: [announce] swappolube to lubricate your gui
 
@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?

IceJunior 2010-09-16 05:45

Re: [announce] swappolube to lubricate your gui
 
Great Work!

thx
Ice

slender 2010-09-16 06:41

Re: [announce] swappolube to lubricate your gui
 
@debernardis

Can you comment on this post:
http://talk.maemo.org/showpost.php?p...8&postcount=41
I do not completely understand it. Tried swapon&swpaoff but got some error message about device being busy.

debernardis 2010-09-16 08:01

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

Originally Posted by slender (Post 817560)
@debernardis

Can you comment on this post:
http://talk.maemo.org/showpost.php?p...8&postcount=41
I do not completely understand it. Tried swapon&swpaoff but got some error message about device being busy.

It's close to greek to me, but then, I'm no expert as I stated before. He has a script, well ask him to share it and let's see where it brings :D


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

vBulletin® Version 3.8.8