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)

retsaw 2010-09-17 22:01

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've been looking at the kernel source to check what this setting affects, and although I couldn't see the direct link between this value and the pages written, the comments and documentation says it does affect it (I'll just assume it is my limited comprehension of the code from seeing how it does), however this value also affects the number of pages that are read ahead of what is requested, which is really for performance on hard drives where seek time is an issue, so the fact reducing this value reduces the number of unnecessary extra reads from swap may improve performance (or it may be insignificant).

Another thing I noticed was that the kernel defaults this value to 3 (or 2 on systems with less than 16MB RAM) and there is a comment that setting it much higher than this causes other issues. While these other issues remain unspecified along with the exact value to trigger them, it may be that that values of 5 or 6 could trigger them.

In all, these changes have seemed to make my N900 more responsive and maybe after a couple of days use with these settings (except the tcp_timestamps since I don't think that is worth doing), I might tweak them one at a time to see which ones really have an effect, my first one will be to change the page_cluster to 3.

droll 2010-09-17 22:26

Re: [announce] swappolube to lubricate your gui
 
i am not seeing this in fam. i have updated the catalogs. what's the package name?

TiagoTiago 2010-09-17 22:27

Re: [announce] swappolube to lubricate your gui
 
it's not in any repository

droll 2010-09-17 22:31

Re: [announce] swappolube to lubricate your gui
 
oh....thanks. will dpkg it then :)

slender 2010-09-17 22:32

Re: [announce] swappolube to lubricate your gui
 
@ droll
If you had read this thread then you would have realized that this is just deb packages provided on messages.

droll 2010-09-17 22:38

Re: [announce] swappolube to lubricate your gui
 
wow, this has changed the responsiveness of the device quite significantly. prior to this i was only running the swappiness setting and that already had a big impact.

thank you for collating these settings into a single package.

mikki-kun 2010-09-18 11:20

Re: [announce] swappolube to lubricate your gui
 
Ö.ö <--- My first impression after I installed that script and started up MicroB and then a message coming in... Man, first time the GUI was faster than me Ö.ö

That package really did improve the speed of the device pretty bad-***. Browsing is now geourgous! Engadget scrolls now like a charm and also having it loaded in the background and switching to it was like half a second :o Amazing
Really, thanks for that. I really needed that. OC'ing becoming more and more obsolete ^^

Cheers,

mikki-kun

TiagoTiago 2010-09-18 11:50

Re: [announce] swappolube to lubricate your gui
 
How long do you guys suggest i wait for the early adopters to start reporting issues before i join in?

atilla 2010-09-18 11:56

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

Originally Posted by TiagoTiago (Post 819691)
How long do you guys suggest i wait for the early adopters to start reporting issues before i join in?

i don't think that there are issues.
and even if something comes,you can simply deinstall the package via HAM

TiagoTiago 2010-09-18 12:10

Re: [announce] swappolube to lubricate your gui
 
no risks of data corruption, reduction of lifetime of components etc?

debernardis 2010-09-18 12:11

Re: [announce] swappolube to lubricate your gui
 
I empirically suggest some care when you shut down your n900. Do a sync in xterm before, so you're sure that everything gets written properly on the flash memory. Then shutoff by the button or give a sudo halt command. Maybe I'm too prudent, but in the last few weeks I've had to reflash too many times (and I wasn't running swappolube yet).

TiagoTiago 2010-09-18 12:14

Re: [announce] swappolube to lubricate your gui
 
any way to automate those precautions so it always happens regardless of how i shut down (i mean, other than when pulling the battery and alike), including sudo reboot ?

fms 2010-09-18 12:15

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

Originally Posted by debernardis (Post 819706)
I empirically suggest some care when you shut down your n900. Do a sync in xterm before, so you're sure that everything gets written properly on the flash memory. Then shutoff by the button or give a sudo halt command. Maybe I'm too prudent, but in the last few weeks I've had to reflash too many times (and I wasn't running swappolube yet).

This is all done automatically when turning the device off via the power button menu. In fact, "halt", "reboot", and "poweroff" will also sync your filesystems before doing their thing, unless you run them with "-n".

slender 2010-09-18 12:31

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

Originally Posted by TiagoTiago (Post 819703)
no risks of data corruption, reduction of lifetime of components etc?

Who knows? Nobody. What did you expect?

Remember to backup.


Always!

TiagoTiago 2010-09-18 13:24

Re: [announce] swappolube to lubricate your gui
 
that is why i'm asking about how long i shuold wait for the early adopters to start reporting issues before i try it myself

atilla 2010-09-18 13:29

Re: [announce] swappolube to lubricate your gui
 
you should make a backup and try it now.
if your device explodes you can make a reflash:)

TiagoTiago 2010-09-19 19:00

Re: [announce] swappolube to lubricate your gui
 
It takes too long to reinstall and setup everything again, i wanna avoid reflashing as much as possible

slender 2010-09-19 19:16

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

Originally Posted by TiagoTiago (Post 820854)
It takes too long to reinstall and setup everything again, i wanna avoid reflashing as much as possible

If so then to maximize odds for keeping your device in shape I suggest that:

- Do not in any means install stuff from devel or testing repositories
- Do not install random packages from from "cool" webpages that show you "amazing" new software
- Do not install packages from TMO message attachements

Capiche?

ndi 2010-09-19 19:36

Re: [announce] swappolube to lubricate your gui
 
The answer is never. We could all be fine and you could have an issue with it.

For example, I was priding myself on never reflashing since December (OTA), with -devel activated and several things installed, like OC kernel.

Then I installed that package that allows you to start what you want on camera slide (can't remember the name). After that, reboot and the phone started, loaded up until the desktop and, when it came time to populate desktop with widgets, reboot.

Had to reflash. I'm pretty sure it's wasn't the package, but the straw that broke the camel's back. Actually, I suspect the currency widget, it's been behaving strangely. Nonetheless, the camera launcher is fine, everyone uses it.

How long before I joined in? Didn't matter.

Point is, you never know, you might as well join in. I'd go for backup menu if you are a reflash hater (aren't we all).

On a brighter note, all this changes are some settings. I find the likelihood of flash-worthy issues to be close to nil.

fms 2010-09-19 21:08

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

Originally Posted by ndi (Post 820875)
Had to reflash. I'm pretty sure it's wasn't the package, but the straw that broke the camel's back.

I am sorry to ask the obvious, but have you tried sacrificing a black goat and drawing "666" with its blood across your N900's screen? I am pretty sure it won't fix any packages but may fix the reboot loop. =)

ndi 2010-09-19 21:37

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

Originally Posted by fms (Post 820932)
I am sorry to ask the obvious, but have you tried sacrificing a black goat and drawing "666" with its blood across your N900's screen?

I was all out of black goats. I only have a white one, but that's an iGoat. Doesn't work on Nokia. Not sure it's an ARM goat, either.

Besides, if I want to keep my warranty, it has to be an Original Nokia Accessory, the GT-003. Have you seen the prices on those?

lq_sunshine 2010-09-20 16:27

Re: [announce] swappolube to lubricate your gui
 
wow.. it really boosted my n900!!

Thanks

zimon 2010-09-20 16:59

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

Originally Posted by debernardis (Post 816676)
I
echo "30" > /proc/sys/vm/swappiness
echo "0" > /proc/sys/vm/page-cluster
echo "1" > /proc/sys/vm/laptop_mode [1]
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

If someone has extra time, would be nice to have URI's for every setting what it really is (to Linux kernel docs for example). Some of them have surely been explained here and there on these posts, but gather them all to one single post or preferrably to this starting post of this thread.

Or a wiki page would be nice for this package and for the settings it use.

[1] http://www.linuxjournal.com/article/7539

(Edit: I did as an example for laptop_mode.)

(Edit2: Oh, didn't try this link in the first post. Maybe they are all there already. And seems also now underneath an another link. But links to actual Linux kernel docs are missing in both.)

noobmonkey 2010-09-20 17:07

Re: [announce] swappolube to lubricate your gui
 
Not quite support (And maybe mentioned in here already - apologies if it is)

But a good little description of most of the above, none the less - http://www.freemaemohelp.com/home/-/ablog/entryId/36094

ndi 2010-09-20 17:32

Re: [announce] swappolube to lubricate your gui
 
echo "30" > /proc/sys/vm/swappiness
Tendency to swap. 0 means swap as a last resort, 100 is swap as soon as possible.

echo "0" > /proc/sys/vm/page-cluster
page-cluster controls the number of pages which are written to swap in a single attempt. The swap I/O size.

echo "1" > /proc/sys/vm/laptop_mode
Laptop mode is used to minimize the time that the hard disk needs to be spun up, to conserve battery power on laptops.

echo "1" > /proc/sys/vm/oom_kill_allocating_task

When out of memory, the OS will kill a task to revive. When 0, kills the largest task. When 1, it kills the task that requested the memory.

echo "0" > /proc/sys/vm/dirty_expire_centisecs

echo "0" > /proc/sys/vm/dirty_writeback_centisecs

The VM subsystem, in the Linux kernel, buffers writes to files that applications perform for a period of time. This caching allows the kernel to group consecutive writes into one big write, and to generally optimize the disk IO to be the most efficient. The kernel, by default, will start writing out data to disk after 5 seconds, so, if a power failure or kernel crash happens, at most, 5 seconds of data would be lost.

echo "60" > /proc/sys/vm/dirty_background_ratio

Contains, as a percentage of total system memory, the number of pages at which the pdflush background writeback daemon will start writing out dirty data.

echo "95" > /proc/sys/vm/dirty_ratio

Contains, as a percentage of total system memory, the number of pages at which a process which is generating disk writes will itself start writing out dirty data.

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


These settings disable some of the features of TCP as defined by the RFC.

Not the best links out there, but it's a first effort.

ETA: Wow, it looked better in preview mode :P

TiagoTiago 2010-09-20 18:59

Re: [announce] swappolube to lubricate your gui
 
which settings get reset at boot and which settings i can change without fighting with the swappo?

egoshin 2010-09-20 19:49

Re: [announce] swappolube to lubricate your gui
 
Some comments:

Quote:

Originally Posted by ndi (Post 821642)
echo "30" > /proc/sys/vm/swappiness
Tendency to swap. 0 means swap as a last resort, 100 is swap as soon as possible.



More precisely - swapout. With 100 the kernel swaps out anything but it doesn't erase it from memory and uses it if it is still in memory. The value 100 guarantee your a minimal time for your application load or swap in, for exam - in a middle of your video somebody calls you and kernel starts downloading phone application immediately.

As disadvantage, 100 forces a flash channel I/O high usage which decreases a performance of downloading because it services swapout each time. It also decreases battery time life because kernel does a lot of unnecessary work.

Quote:

echo "0" > /proc/sys/vm/page-cluster

Quote:

page-cluster controls the number of pages which are written to swap in a single attempt. The swap I/O size.
The value "0" provides you a wider I/O channel to download application from flash because kernel uses small blocks for swapping and can put an application load request faster. In over case it may increase your swapout time and wear eMMC much faster.

Quote:


echo "1" > /proc/sys/vm/laptop_mode
Laptop mode is used to minimize the time that the hard disk needs to be spun up, to conserve battery power on laptops.
It forces a huge time delay (up to 10min) between file system writes. Usually it is OK for N900 but if you have some regular system halts, unexpected reboots etc then you are in danger of losing directory data --> loosing your user files (even old and unchanged) and forcing system problems too.

Actually, it is not good things because "laptop_mode" was designed for disks - it tries to group multiple writes in short time instead of spreading it, so, it is a good for disks spin down. But it has no sense for flash-based systems like N900 and introduces a serious danger of losing old files.

Airtux 2010-09-20 19:57

Re: [announce] swappolube to lubricate your gui
 
I'm Sorry, but I do not understand what is this application, you can explain?
Thanks

cfh11 2010-09-20 20:10

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

Originally Posted by Airtux (Post 821771)
I'm Sorry, but I do not understand what is this application, you can explain?
Thanks

You know what they say about staying away from extras-devel unless you know what you're doing? That x1000 for .debs and scripts posted outside the repositories.

Alanstrainor 2010-09-20 20:45

Re: [announce] swappolube to lubricate your gui
 
Thanks a lot, noticed an immediate speed increase.

les_garten 2010-09-20 20:49

Re: [announce] swappolube to lubricate your gui
 
How do you remove this? RM a tuning script in /etc/event.d?

I've noticed a lag, like I have to wake it(N900) up and then it starts working.

egoshin 2010-09-21 01:16

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

Originally Posted by les_garten (Post 821814)
How do you remove this? RM a tuning script in /etc/event.d?

I've noticed a lag, like I have to wake it(N900) up and then it starts working.

It may be effect of low swappiness.

les_garten 2010-09-21 01:44

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

Originally Posted by egoshin (Post 821931)
It may be effect of low swappiness.

I've been running the swappiness mod for a few weeks, don't think that was it.

F2thaK 2010-09-21 02:07

Re: [announce] swappolube to lubricate your gui
 
bit the bullet and installed new version, after v1 caused me to have to reflash

did a sync and halt... then a reboot. seems fine.

debernardis 2010-09-21 04:41

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

Originally Posted by les_garten (Post 821814)
How do you remove this? RM a tuning script in /etc/event.d?

Just remove from application manager or from fapman; or use xterm as root: dpkg -r swappolube.

arnoldux 2010-09-21 05:16

Re: [announce] swappolube to lubricate your gui
 
just a single question before i try it cuz it looks great, does it work with stock kernel? or do i need to install the titans kernel

cheers

zlatko 2010-09-21 05:47

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

It works fine with stock kernel.

Alex Atkin UK 2010-09-21 23:26

Re: [announce] swappolube to lubricate your gui
 
I'm confused, is laptop mode really a good idea when its optimised for HDD use not flash? I have read a few comments which seems to imply its probably a bad idea.

Saturn 2010-09-22 00:12

Re: [announce] swappolube to lubricate your gui
 
2 Attachment(s)
Quote:

Originally Posted by debernardis (Post 819165)
... Anybody willing to volunteer?

Hi,

Here is a simple GUI (created with PyQT) that creates the "tuning" file and copies it to the event.d folder.

The first row of checkboxes is to enable the setting. If unchecked it will not write anything for this option.
The second row if checked will give a "1" if not then it's a "0".

Pressing the "Create Settings" button overwrites the current tuning file with what exactly is chosen at that time in the GUI.

I have tested it but please test yourself too.

Attached is the deb you can install using the HAM and will create a blue icon in the applications for you to start it.

If you have simple features/requests I will try to implement but might take time - too busy at the moment.

Enjoy tuning your N900 but beware that these tunings are for brave people only - whiners stay away. :D

EDIT: An uninstall will not remove the tuning file on this version (will fix this later) in the meantime to remove completely open xterm and execute as root:
Code:

rm /etc/event.d/tuning

debernardis 2010-09-22 05:11

Re: [announce] swappolube to lubricate your gui
 
@Saturn: great work, mate!
Would you mind adding /proc/sys/vm/vfs_cache_pressure, while we're in experimenting? Default value is 100. It's been researched for the N8x0 by brontide and co. :)

EDIT: on my machine the /etc/event.d/tuning script doesn't get created when I push the save button or when I close the python app.
Also, one useful thing would be having at least two pre-defined configs, i.e. the the default one and the Simon-kaze.daniel-alltimeswerout one, just to start.


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

vBulletin® Version 3.8.8