maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   I/O nr_requests (https://talk.maemo.org/showthread.php?t=70073)

Turok101 2011-02-19 03:50

I/O nr_requests
 
I wanted to find something to balance out the n900 I/Os and get a consistently smooth experience. I came across the I/O queue depth parameter nr_requests which is found here:
Code:

/sys/block/mmcblk0/queue/nr_requests
/sys/block/mmcb1k1/queue/nr_requests

This parameter is 128 by default. I read Zan Lynx's comment from this website:
http://stackoverflow.com/questions/3...y-is-happening

Then I read a bit more on nr_requests and found this site:
http://yoshinorimatsunobu.blogspot.com/2009/04/linux-io-scheduler-queue-size-and.html


I changed my nr_requests to 100000 and it feels like a balanced system and things are smooth. It's like this is what was missing.

Hope it helps...and don't forget to thank me :D

epitaph 2011-02-19 03:59

Re: I/O nr_requests
 
I have tried 4000 but now I try 4 like nightfire's setting! Thanks for this!

Mentalist Traceur 2011-02-19 04:07

Re: I/O nr_requests
 
On the N900, I think tuning it down is better, so long as you also down tune down the dirty ratio and dirty background ration... swappiness lower probably helps too.

Not sure though. I may try the significantly higher values later, see if there's a difference.

epitaph 2011-02-19 04:09

Re: I/O nr_requests
 
Quote:

Originally Posted by Mentalist Traceur (Post 950248)
On the N900, I think tuning it down is better, so long as you also down tune down the dirty ratio and dirty background ration... swappiness lower probably helps too.

Not sure though. I may try the significantly higher values later, see if there's a difference.

yes it is better to tune down. 4 seems to be a good value also this is a flash and ssd device so it doesn't need much readahead i think.

nightfire 2011-02-19 05:06

Re: I/O nr_requests
 
Careful; the larger the I/O request queue, the more likely it is you'll lose data on power loss or if your phone crashes.

shadowjk 2011-02-19 11:21

Re: I/O nr_requests
 
nr_requests doesn't affect the amount of data cached before writing, or the duration before data gets written.

MMC/SD and usb flash drives behaves completely different than real SSDs. The emmc in n900 will do something like 8megabytes/second writing sequentially, and 30 kilobytes/second when fed random writes.

That means the better sorted requests to it are, the better throughput will be. Note I said throughput, not interactivity, which is probably what users mostly notice.

hawaii 2011-02-19 14:05

Re: I/O nr_requests
 
Oh how I wish we could keep this all on one thread.

nightfire 2011-02-20 05:06

Re: I/O nr_requests
 
Quote:

Originally Posted by shadowjk (Post 950357)
nr_requests doesn't affect the amount of data cached before writing, or the duration before data gets written.

MMC/SD and usb flash drives behaves completely different than real SSDs. The emmc in n900 will do something like 8megabytes/second writing sequentially, and 30 kilobytes/second when fed random writes.

That means the better sorted requests to it are, the better throughput will be. Note I said throughput, not interactivity, which is probably what users mostly notice.

It will...

I/O queues become populated after pages become eligible for flushing. So, it adds to the write delay. It's possible to have 128 writes queued up even if your dirty_expire_centisecs or dirty_background_ratio is 0, if your nr_requests is 128+.

If you lose power at that point, those writes are gone.

I myself haven't notice any loss in bandwidth switching to a queue depth of 1.

Turok101 2011-02-21 04:28

Re: I/O nr_requests
 
I've noticed that nr_requests at a low number like 4 or 1 sucks for me. The high number is much better, but there is no great way to know the optimal value.

My approach is that I can start at a low number like 1 and work my way up until the performance improvement isn't as much. Then stop there because the net improvement is not worth the additional risk of losing data.

At 128, you hardly have performance improvement...still have more to go to see it. I settled on 8192 for now to not have it quite so high and seems like pretty much the same as 100000. 128 is not enough for the I/O scheduler and whatever else to work with and do a good job apparently.

I told my friend who is using Android on his HTC nexus one to give it a try and he's underclocking his system now because of it :)


All times are GMT. The time now is 19:19.

vBulletin® Version 3.8.8