![]() |
Re: N900, ohmd, syspart, VM & swap tweaks
Quote:
What I can affirm is that on my machine in its current state, the baloons are now delayed (also 5 or 10 seconds) while chatting, don't know about emails, but I hear both vibration and notification sounds. |
Re: N900, ohmd, syspart, VM & swap tweaks
if your configurations really make the n900 snappier and more responsive without sacrificing anything else, it should really be in a wiki or included via swappolube or something...
This is just a great work that you've done. Marvellous |
Re: N900, ohmd, syspart, VM & swap tweaks
As for kernel reporting mmcb blocksize as "512k", it's not. It's saying logical blocksize is 512 bytes. This is meaningless for your purposes though, it only tells you the smallest request size that the mmc will accept. Internally it then translates 512 byte write into a read-modify-erse-write cycle of 128k or 256k, whatever its true block size is.
This brings us to the "noop" scheduler issue. You are correct that there are no moving parts, but the huge blocksize calls for scheduling writes close to eachother anyway, to minimize the amount of read-modify-erase-write cycles the mmc/usd has to do. Imagine if kernel sends request for writing 4k at position 2M, and then 4k at position 8M, and 4k at position 2M+4k, 4k at 8M+4k, and so on. Each request makes the uSD/emmc internally read 128k (assuming that's the true eraseblocksize), change 4k of that 128k, erase another 128k block, write 128k to that block. A write amplification factor of 32. You can divide your raw write rate of a nominal 6Meg/s for Class6 with 32 to get estimated 192 kilobytes/sec... So ideally we'd want an elevator that knows about the special properties of flash. but we don't have one, so we use CFQ. which atleast has some heuristics for distributing IO "fairly" between processes. Incidentally, this is where the explanation for why moving swap to uSD seems to improve performance begins too. The heaviest loads for the emmc is swap, and anything that uses databases like sqlite. That includes dialer and conversations, calendar, and many third party apps. Why is this a heavy load? Because these things typically write tiny amounts of data, and then request fsync() to ensure the data is on the disk. This triggers the writeout of all unwritten data in memory, and updating all the filesystem structures. Remember that a tiny amount of data spread out randomly triggers massive amount of writing internally to the emmc. Worse, while this goes on, all other requests are blocked. And what else besides /home and swap is on emmc? /opt. Containing, these days, both apps and vital parts of the OS. The CPU is starved for data, waiting for requests to be written out so that the requests for the executable demand-paged code of apps can complete. Btw for Harmattab I'm told sqlite will be using a more optimized db, that essentially works like one gigantic journal. Sequential writing is fast and good on flash, random in-place updates is bad. Moving swap to uSD gives a path for swap that is always free (well almost always unless you do heavy acesses to uSD by other means), and offloading swap from emmc means less random IO load on the emmc. |
Re: N900, ohmd, syspart, VM & swap tweaks
@jurop88
lots of respect and thanks..thats fantastic and lots of mindblowing effort you have put in. it took me 3 reads just to understand things you have tried out.. very impressive..hope u do some more r&d and we can make the n900 more better Thanks |
Re: N900, ohmd, syspart, VM & swap tweaks
Hi Shadowjk,
thank you for you participation. Quote:
1) why 512k will mean 512 byte? Can you point me somewhere, also through kernel source? I just started digging on the matter, found relevant code in the mmc driver (I hope to be on the right path to understand something) but I must admit my C knowledge is rather rusty 2) where to find the true HW block dimension? Is there a place where is it reported or shall I know it directly from the uSD producer? The 128k size, though, explains why Nokians choosed to set page-cluster to 5; 32*4=128 and that's it Quote:
Quote:
Wikipedia again, Quote:
After having used the setting in the first page for some days, I have to say that with NOOP probably the fragmentation is bigger, but the feeling is that it works faster UNTIL IT WORKS. Another member on the forum (don't remember precisely who) set a swap rotation during the night in order to avoid this fragmentation, and I can confirm that after two days my N900 started 'choking' and a swapon/swapoff/swapon/swapoff let it fly again, in line with identifying the issue due to swap fragmentation. Quote:
What we ideally need is a scheduler saying: Code:
- kernel: we need some free room. I have already found an example of NOOP scheduler written in C on the internet, and it does not look to much hard to implement. Here we are speaking of brute force, not high math ;) - A simple modified NOOP algorithm good for flash could look like: Code:
- check if the page to be unloaded is already cached and not dirty or in the current queue Quote:
On a side note, I am digging into the ohmd & cgroups realm and I am happy to have learnt lot of things :) - probably the parameters in the first page will be tuned again after some days of usage and having looked at the patterns arised in terms of load and memory used. EDIT - oh, and I forgot to report this https://bugs.maemo.org/show_bug.cgi?id=6203 where many hints on ohmd & syspart are given! |
Re: N900, ohmd, syspart, VM & swap tweaks
hehe it looks like I made some confusion amongst kswapd and IO scheduler - still learning a lot in this illness period :)
|
Re: N900, ohmd, syspart, VM & swap tweaks
Hi jurop88,
I've spent at least 20 minutes trying to find again this thread as I'm doing some experiments with information that is split across multiple threads:
And this one ;) Have you made any more progress? |
Re: N900, ohmd, syspart, VM & swap tweaks
Quote:
I since wrote the orginal post made some slight modifications, but still not updated here. Perhaps will do it through the WE |
Re: N900, ohmd, syspart, VM & swap tweaks
Quote:
|
Re: N900, ohmd, syspart, VM & swap tweaks
> partition desktop memory-limit 70M
When I've cgroups mounted I noticed that the desktop groups only need 25M. So, it's better to write partition desktop memory-limit 25M or echo "25M" > /dev/cgroup/cpu/desktop/memory.limit_in_bytes. |
All times are GMT. The time now is 05:29. |
vBulletin® Version 3.8.8