maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   Massive interactivity improvement under high I/O load! (https://talk.maemo.org/showthread.php?t=69973)

epitaph 2011-03-06 18:56

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by nightfire (Post 959838)
Hey epitath,

There are two configurations:

What you have is like raid-0 "concat" mode. Basically, when your highest priority swap runs out of space (SD, because -1 > -2), it'll start swapping to the next highest priority swap area (internal).

Your total available swap space is the sum of these two.

This configuration is particularly useful when you have block devices of differing speeds (ie. compressed ramdisk and slow media) since you can tell the kernel to use the fast device until it's full, and then start using the slow device. It would be even more useful if the kernel could migrate infrequently used pages from fast->slow in the background, but I'm not sure if anyone has implemented it.

The other configuration is like raid-0 "striping" mode. When you have your swap areas set to the exact same priority, the kernel will interleave blocks between the two. This theoretically increases both read and write bandwidth, just as it does with striped raid-0, since the kernel can parallelize the writes, and some reads.

Like the "concat" configuration, your total available space is the sum of the two, though the "stripable" area (increased bandwidth) is equal to 2x the size of the smallest area.

Hi nightfire,

thank u for ur reply but my device feels better with my setting. Maybe it is a bug?

hawaii 2011-03-06 19:24

Re: Massive interactivity improvement under high I/O load!
 
Your device feels better because it's not "colliding" IO all the time with swapping off eMMC while trying to read and write data.

I've set up a script that does some sanity checks -- plugged in? charging? locked? 3 AM? and will "re" swap out of internal, onto external and back onto the internal in order to clear out.

epitaph 2011-03-06 19:36

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by hawaii (Post 961983)
Your device feels better because it's not "colliding" IO all the time with swapping off eMMC while trying to read and write data.

I've set up a script that does some sanity checks -- plugged in? charging? locked? 3 AM? and will "re" swap out of internal, onto external and back onto the internal in order to clear out.

Thanks for the script but I'm talking about my settings ( and my tools ). I know about pci-interface and bus and that concurrent interface when connecting more then 1 harddisk to the computer. If u have read my posts in this thread I use a readahead of 16 and nr_requests < 4. I've tested nightifire setting with swappoff /dev/mmcblk0k3. I think the priority for SD remains the same ( -1 ) but it is much slower. I didn't tried his swapon-tool because it didn't work on my device. This is something I can test again and setting prio to 1 like nightfire suggest but right now my setting with the 2 swap-space is much faster. I think it is a bug or my tool is crap but I don't think so.

hawaii 2011-03-06 20:00

Re: Massive interactivity improvement under high I/O load!
 
You fail to understand you are NOT using 2 swap spaces currently. NO data is being written to your lower priority swap.

epitaph 2011-03-06 20:12

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by hawaii (Post 961994)
You fail to understand you are NOT using 2 swap spaces currently. NO data is being written to your lower priority swap.

And u fail to understand me that I'm using my setting and my device is faster no matter if data is written to the internal device or not just because I add internal swap to a lower priority to external swap and I have 2 swap spaces. I'm not in a kindergarten here, am I? It could be a bug.

d-iivil 2011-03-06 21:11

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by epitaph (Post 961997)
It could be a bug.

No, it's not a bug. Everything is working just LIKE YOU HAVE SET THEM TO WORK.

/me cannot locate the problem here...

hawaii 2011-03-06 21:11

Re: Massive interactivity improvement under high I/O load!
 
Then this has NOTHING to do with offloading swap to an external microsd card since you are NOT doing so.

Between this and your other threads, I am hard pressed to decide whether or not you are actually in kindergarten.

epitaph 2011-03-06 21:25

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by d-iivil (Post 962025)
No, it's not a bug. Everything is working just LIKE YOU HAVE SET THEM TO WORK.

/me cannot locate the problem here...

If u read the thread and nightfire is right with his conclusion then it is a bug because my device is feeling faster with external swap set to -1 and internal swap set to -2. Seriously what is so hard to understand that it can be a bug in maemo? after all u aren't responding to this thread if ur not into tweaking stock settings and also there is enough others bugs to write about it? Maybe ur just too lazy but then u could write it nobody will care about it!

epitaph 2011-03-06 21:28

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by hawaii (Post 962027)
Then this has NOTHING to do with offloading swap to an external microsd card since you are NOT doing so.

Between this and your other threads, I am hard pressed to decide whether or not you are actually in kindergarten.

Thanks for this :).

strange1712 2011-03-07 01:51

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by d-iivil (Post 962025)

/me cannot locate the problem here...

Me Neither. I've set nightfire values from 1st post and Epitaph tune-up's, and can't find any real improvement when overloaded in contrast with only swappolube. For example, opening Facebook in my device paralyze it for about half a minute.. or opening Chromium, or installing some app (specially using HAM)...
Internet Browsing in MicroB was getting laggy don't know why, and after applying epitaph's tweaks it lags less but sometimes simply won't load anything... So don't know...

What really amaze me is people getting so heavy about this. It's clear there is no bug at all here, and that using SD-only swap seems to be the best try as both epitaph and nightfire has found, even if epitaph won't accept it (but that's not a bug at all).
(But my uSD is veery slow so i won't do that)

ArnimS 2011-03-07 03:03

Re: Massive interactivity improvement under high I/O load!
 
Swappolube did not fix my copy large file problems. This did. Thanks.

epitaph 2011-03-07 06:23

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by strange1712 (Post 962159)
Me Neither. I've set nightfire values from 1st post and Epitaph tune-up's, and can't find any real improvement when overloaded in contrast with only swappolube. For example, opening Facebook in my device paralyze it for about half a minute.. or opening Chromium, or installing some app (specially using HAM)...
Internet Browsing in MicroB was getting laggy don't know why, and after applying epitaph's tweaks it lags less but sometimes simply won't load anything... So don't know...

What really amaze me is people getting so heavy about this. It's clear there is no bug at all here, and that using SD-only swap seems to be the best try as both epitaph and nightfire has found, even if epitaph won't accept it (but that's not a bug at all).
(But my uSD is veery slow so i won't do that)

Ur right I don't accept it but thank u for ur help!

niko3d 2011-03-09 10:54

Re: Massive interactivity improvement under high I/O load!
 
Just a heads up this also works very well for me. Especially with unpacking of large zipped files etc I tried using the webos game manager this morning my m900 struggled unpacking the ipk files for settlers and eventually it crashed out with a full reboot also the ui was very unresponsive during that period.
I used the settings described here and it worked a treat and a hell of alot faster and no real impact in terms of responsiveness .
Glad I remembered about this post :¬)
Cheers
Nick

thingonaspring 2011-03-09 11:53

Re: Massive interactivity improvement under high I/O load!
 
Anyone had any luck getting these settings to apply at boot?
I've tried pretty much everything I can think of but can't get /proc/sys/vm/swappiness to report any value other than "100" after a clean boot.
So far I've tried adding a script to /etc/event.d using the "start on startup" event, creating a script in rc2.d and rcS, none of which have any effect.
If I run the same script manually after boot, then all works nicely.
Anyone got any clues what I'm doing wrong?

nightfire 2011-03-09 15:55

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by thingonaspring (Post 963950)
Anyone had any luck getting these settings to apply at boot?
I've tried pretty much everything I can think of but can't get /proc/sys/vm/swappiness to report any value other than "100" after a clean boot.
So far I've tried adding a script to /etc/event.d using the "start on startup" event, creating a script in rc2.d and rcS, none of which have any effect.
If I run the same script manually after boot, then all works nicely.
Anyone got any clues what I'm doing wrong?

I just put my settings near the end of /etc/event.d/rcS-late.

I'll be releasing a debian package soon as well.

mehulrajput 2011-03-09 19:48

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by thingonaspring (Post 963950)
Anyone had any luck getting these settings to apply at boot?
I've tried pretty much everything I can think of but can't get /proc/sys/vm/swappiness to report any value other than "100" after a clean boot.
So far I've tried adding a script to /etc/event.d using the "start on startup" event, creating a script in rc2.d and rcS, none of which have any effect.
If I run the same script manually after boot, then all works nicely.
Anyone got any clues what I'm doing wrong?


I have my own scripts which does host of things including this settings.

just copy and paste the rcS-late to whichevever you want. keep it in /etc/event.d

now here is the main thing to remember. Do not repeat do not make any typos in the script as for me some how when I have given dirty__ instead of dirty_ the script stopped going forward hence all settings were not coming through.

I modified this error and rebooted and voila all my settings are taking in to effect.

thingonaspring 2011-03-09 22:48

Re: Massive interactivity improvement under high I/O load!
 
Thanks guys, that worked first time :-)

Dark_Angel85 2011-03-09 23:19

Re: Massive interactivity improvement under high I/O load!
 
hmmm.. tried the scripts in the first post... didn't seem to make much of a difference....

nightfire 2011-03-10 04:07

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by Dark_Angel85 (Post 964472)
hmmm.. tried the scripts in the first post... didn't seem to make much of a difference....

You'll only notice a difference under intense I/O. Try writing a 2gb file to your SD card with the standard configuration... it'll tend to lock the device up. Then try it with these settings.

Bratag 2011-03-10 04:18

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by nightfire (Post 964587)
You'll only notice a difference under intense I/O. Try writing a 2gb file to your SD card with the standard configuration... it'll tend to lock the device up. Then try it with these settings.

Settings seemed to help me last time I was doing a large untar.

TiagoTiago 2011-03-11 00:57

Re: Massive interactivity improvement under high I/O load!
 
Is there a quick test i can run to compare the performance with and without these mods?

geneven 2011-03-11 01:14

Re: Massive interactivity improvement under high I/O load!
 
The lines that form in the task-switching area -- they are from the CSSU? How do I get rid of them?

nightfire 2011-03-11 03:35

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by TiagoTiago (Post 965400)
Is there a quick test i can run to compare the performance with and without these mods?

Sure, try:

Code:

dd if=/dev/zero of=/media/mmc1/testfile bs=1024k count=512
That will create a 512mb file on your SD card as fast as it can write. While it does that, try using the phone other tasks.

freemangordon 2011-03-11 06:33

Re: Massive interactivity improvement under high I/O load!
 
Guys
I've been playing with settings from the first post and other things these days and so far my conclusions are:
Right after reboot the phone is fast and smooth, but in time performance degrades severely up to the point it becomes unresponsive for several seconds. Right now I am using only swappines 30 and nr_requests of 128 and the overall performance is great. Reducing nr_reqauests to 4 reduces io throuput to several K per second so it is not " option for me.

To test performance I was extracting ubuntu image on EMMC. While doing that I was changing different settings of io scheduler, including changing scheduler to to noop. With moderate result. My point was - why when one is copying file over USB there is absolutely no lag, but when doing same thing on n900 it freezes. The last thing to do was to play with swap - bingo, at the moment I swapoff EMMC swap, extracting speed raise to about 10 MB/s with no lagging at all. And the strange thing is that performance raise at the moment I did swapoff, even before swap was transferred to sdcard swap partition. Swap priorities do not matter - as long as EMMC swap is turned on, performance degrades severely. And I cannot see relation with behaviour under USB.Will continue to play with that and will report if find something

Saturn 2011-03-11 19:58

Re: Massive interactivity improvement under high I/O load!
 
Hi,

Great work. Didn't notice this till ivgalvez pointed it to the swappolube thread (http://talk.maemo.org/showpost.php?p...&postcount=339).

Just wanted to mention that will add the three missing/new fields in the Swappolube app (as soon as I read a little bit this thread).
Hope it is useful for your tests.

Cheers.

Temporal 2011-03-11 20:03

Re: Massive interactivity improvement under high I/O load!
 
What's the difference between swappolube and this?

casketizer 2011-03-11 20:12

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by Saturn (Post 965961)
Hi,

Great work. Didn't notice this till ivgalvez pointed it to the swappolube thread (http://talk.maemo.org/showpost.php?p...&postcount=339).

Just wanted to mention that will add the three missing/new fields in the Swappolube app (as soon as I read a little bit this thread).
Hope it is useful for your tests.

Cheers.

Not sure that is a good idea. Other than the current tweaks in swappolube the tweaks from this thread can cause serious problems. They sure do for me.

ivgalvez 2011-03-11 21:50

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by casketizer (Post 965970)
Not sure that is a good idea. Other than the current tweaks in swappolube the tweaks from this thread can cause serious problems. They sure do for me.

Having them in Swappolluble will allow easier testing and reverting values.

casketizer 2011-03-11 22:12

Re: Massive interactivity improvement under high I/O load!
 
Well they should at least not be made part of the recommended settings set.

kpoman 2011-03-12 15:36

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by freemangordon (Post 965563)
Guys
I've been playing with settings from the first post and other things these days and so far my conclusions are:
Right after reboot the phone is fast and smooth, but in time performance degrades severely up to the point it becomes unresponsive for several seconds. Right now I am using only swappines 30 and nr_requests of 128 and the overall performance is great. Reducing nr_reqauests to 4 reduces io throuput to several K per second so it is not " option for me.

To test performance I was extracting ubuntu image on EMMC. While doing that I was changing different settings of io scheduler, including changing scheduler to to noop. With moderate result. My point was - why when one is copying file over USB there is absolutely no lag, but when doing same thing on n900 it freezes. The last thing to do was to play with swap - bingo, at the moment I swapoff EMMC swap, extracting speed raise to about 10 MB/s with no lagging at all. And the strange thing is that performance raise at the moment I did swapoff, even before swap was transferred to sdcard swap partition. Swap priorities do not matter - as long as EMMC swap is turned on, performance degrades severely. And I cannot see relation with behaviour under USB.Will continue to play with that and will report if find something

Freemangordon, what setting do you suggest for being able to install and update the deb image ? I had lot of reboots while updating and lot of corruptions and starte verytime from zero which makes me sick !
Help

mehulrajput 2011-03-12 15:44

Re: Massive interactivity improvement under high I/O load!
 
I used these settings for sometime and I donot find that significant difference. Infact my comp (N900) hung up so bad with some application being installed with fam.

I changed the nr_requets to 64 (half of default) and vfs_cache_pressure to 20. Now it is better compared to the settings suggested in 1st post.

freemangordon 2011-03-12 19:24

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by kpoman (Post 966347)
Freemangordon, what setting do you suggest for being able to install and update the deb image ? I had lot of reboots while updating and lot of corruptions and starte verytime from zero which makes me sick !
Help

These are my settings, try them if you dare :D

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

did not benchmark anything, but phone is responsive while doing

/home/user/MyDocs# lzma -d ubuntu-m5-v1.2.img.ext2.lzma

swap is on EMMC, my sdcard is only class 2, but even with such slow card phone feels better with swap on it.

mehulrajput 2011-03-13 05:41

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by mehulrajput (Post 966349)
I used these settings for sometime and I donot find that significant difference. Infact my comp (N900) hung up so bad with some application being installed with fam.

I changed the nr_requets to 64 (half of default) and vfs_cache_pressure to 20. Now it is better compared to the settings suggested in 1st post.

even with nr_requests at 64 my comp was not responding when io was happening.

I increased the nr_requests to 256 and swapiness to 50 and it is now working much better. even when some app is being installed. i do just normal stuff like browing installing apps and some chat. seems these settings are for those who are doing high io all the time.

Saturn 2011-03-13 09:54

Re: Massive interactivity improvement under high I/O load!
 
1 Attachment(s)
Hi again,

as promised uploaded a new version of Swappolube editor app in devel (1.1-1) with support for these new options.

Note that:
- the swappolube proposed values remain the same.
- the mmc1 options are disabled if there is no mmc1 installed.

debernardis 2011-03-13 10:04

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by Saturn (Post 966731)
Hi again,<br />
<br />
as promised uploaded a new version of Swappolube editor app in devel (1.1-1) with support for these new options.<br />
<br />
Note that: <br />
- the swappolube proposed values remain the same.<br />
- the mmc1 options are disabled if there is no mmc1 installed.

<br />
<br />

Code:

$ /opt/swappolube/swappolube.py
Traceback (most recent call last):
  File "/opt/swappolube/swappolube.py", line 767, in <module>
    myapp = MyMainWindow()
  File "/opt/swappolube/swappolube.py", line 169, in __init__
    self.ui = Ui_swappolube()
NameError: global name 'Ui_swappolube' is not defined


epitaph 2011-03-13 10:41

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by freemangordon (Post 966450)
These are my settings, try them if you dare :D

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

did not benchmark anything, but phone is responsive while doing

/home/user/MyDocs# lzma -d ubuntu-m5-v1.2.img.ext2.lzma

swap is on EMMC, my sdcard is only class 2, but even with such slow card phone feels better with swap on it.

Thank you for sharing this. I've add it to my tune-up tools but I didn't noticed any (big) difference. My device is already fast as hell and got a good throughput! Do you know the original values? Anyway swapiness of 30 didn't work for me because cuteTube stop working.

Saturn 2011-03-13 10:58

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by debernardis (Post 966734)
<br />
<br />

Code:

$ /opt/swappolube/swappolube.py
Traceback (most recent call last):
  File "/opt/swappolube/swappolube.py", line 767, in <module>
    myapp = MyMainWindow()
  File "/opt/swappolube/swappolube.py", line 169, in __init__
    self.ui = Ui_swappolube()
NameError: global name 'Ui_swappolube' is not defined


Thanks,

An update will be uploaded in 5 min or so..

PS: if cannot wait the line 169 in swappolube.py needs to be changed to
Code:

    self.ui = Ui_Swappolube()

freemangordon 2011-03-13 12:35

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by epitaph (Post 966747)
Thank you for sharing this. I've add it to my tune-up tools but I didn't noticed any (big) difference. My device is already fast as hell and got a good throughput! Do you know the original values? Anyway swapiness of 30 didn't work for me because cuteTube stop working.

Did I mention that those are the ONLY tunnings I use(and some in transitions.ini)? And it makes huge difference compared to stock?

BTW if your device is very fast before applying above settings, it is reasonable that you won't see any difference. But just for experiment you can try and open as much applications as you can to see if it feels different ;)

epitaph 2011-03-13 12:52

Re: Massive interactivity improvement under high I/O load!
 
Quote:

Originally Posted by freemangordon (Post 966803)
Did I mention that those are the ONLY tunnings I use(and some in transitions.ini)? And it makes huge difference compared to stock?

BTW if your device is very fast before applying above settings, it is reasonable that you won't see any difference. But just for experiment you can try and open as much applications as you can to see if it feels different ;)

Yeah, you did mentioned it! I've understood but I use a lot more of tweakings but not the graphic tweaking like transitions etc. pp. still my device feels a bit faster with your settings. Thanks again! I use 640 for readahead. I wish I could change the scheduler to noop because I have noop [ cfs ] and it seems to me the file is write-protected.

Alfred 2011-03-13 13:44

Re: Massive interactivity improvement under high I/O load!
 
Hello everybody! Thanks for another great changable stuff. I'm noob right here, so could You provide me with the number for these new fields, which would make my beast faster? i don't really copy a lot of files, so just for the system and stuff...
Thanks in advance


All times are GMT. The time now is 20:05.

vBulletin® Version 3.8.8