maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   Using Micro SD Card as Virtual Ram on Nokia N900? (https://talk.maemo.org/showthread.php?t=42357)

omri 2010-04-02 19:30

Re: Using Micro SD Card as Virtual Ram on Nokia N900?
 
Quote:

Originally Posted by plaban (Post 592948)
I have formatted the card from mobile before using it.

Do you happen to remember the exact commands you used?

plaban 2010-04-02 19:33

Re: Using Micro SD Card as Virtual Ram on Nokia N900?
 
I used File Manager to format the card

shadowjk 2010-04-02 20:09

Re: Using Micro SD Card as Virtual Ram on Nokia N900?
 
Quote:

Originally Posted by Konceptz (Post 592971)
I think this is somewhat pointless as the reason for striping was to use both hard drive's spin speed to increase data rate where the bottleneck is always the hard drive.

In this case, "conventional" seek time bottlenecks are eliminated due to the type of memory. Unless something is wrong with implementation, the default swap setup should be pretty much 100% of the speed you can get for "virtual memory".

But there are far more factors than "it should work this way". Therefore, if many people are coming up with a much faster swap solution by switching to a class 6 card, maybe we can also see if we can't pinpoint the slow down? (ie. throughput, kernel handling, etc..)

emmc/sd behave worse than a harddrive really...

The internal block size is something like 256k, if you write 4k (page size), then write 4K somewhere else, then the emmc/sd must internally read 256k, modify the 4k, write back 256k. This makes emmc/sd behave alot like a hard drive that hates seeks.

256 / 4 is 64, that is, worst case speed is the sequential write speed divided by 64. Or, in the case of a class 6 microsdhc card, the worst case speed is 96 kilobytes/sec.

Most swap activity is random I/O.

But anyway, even if this was not the case, striping across two devices doubles the bandwidth anyway.

nightfire 2010-04-02 20:26

Re: Using Micro SD Card as Virtual Ram on Nokia N900?
 
Quote:

Originally Posted by Konceptz (Post 592971)
I think this is somewhat pointless as the reason for striping was to use both hard drive's spin speed to increase data rate where the bottleneck is always the hard drive.

In this case, "conventional" seek time bottlenecks are eliminated due to the type of memory. Unless something is wrong with implementation, the default swap setup should be pretty much 100% of the speed you can get for "virtual memory".

But there are far more factors than "it should work this way". Therefore, if many people are coming up with a much faster swap solution by switching to a class 6 card, maybe we can also see if we can't pinpoint the slow down? (ie. throughput, kernel handling, etc..)

That's sequential raid; striped raid increases throughput by parallelizing I/O. The access time on flash might be low, but the throughput isn't high, so reading/writing concurrent devices should increase performance.

Sequential raid has no effect on streaming I/O, but allows concurrent yet disparate requests to execute concurrently.

Having said all that, I was hoping to reduce disk load on the internal MMC so that its queue would stay more empty. But, someone pointed out that most of the system is on another block device anyway, so it would only affect /home (ie. opt, user files, etc).

*edit* I just re-read your post and my response might not make sense. :) I meant that striping across multiple devices increases bandwidth at the cost of slightly increasing access time. Sequential raid has no effect on bandwidth, but can reduce access time in some cases. In our case, striping across two block devices (ie. internal MMC + SD) could help us increase total swap bandwidth.

nightfire 2010-04-02 20:34

Re: Using Micro SD Card as Virtual Ram on Nokia N900?
 
Hmm.. I wonder if there are any potential performance gains by setting the page size to the MMC / SD block size (if possible) or forcing the kernel to only swap, say, 64 pages at a time. Is it possible the kernel is writing out 4kb pages in separate I/O operations?

nielsvg 2010-04-02 20:36

Re: Using Micro SD Card as Virtual Ram on Nokia N900?
 
can we do something wrong with running this scripts? is this more pro or can a noobie dare the same?

Elhana 2010-04-02 21:07

Re: Using Micro SD Card as Virtual Ram on Nokia N900?
 
Quote:

Originally Posted by nielsvg (Post 593054)
can we do something wrong with running this scripts? is this more pro or can a noobie dare the same?

A good rule is if you don't understand what a command does - don't run it or be ready to reflash. At least "fdisk", rest are mostly harmless.
edit: "mkswap /dev/mmcblk1p1" will erase all data on a sd card ofc.

shadowjk 2010-04-03 09:33

Re: Using Micro SD Card as Virtual Ram on Nokia N900?
 
page-cliuster size is already set to 128k, iirc. It helps at the start, but after some time the swap area has become fragmented enough that swapout becomes more 4k random writes

plaban 2010-04-03 09:35

Re: Using Micro SD Card as Virtual Ram on Nokia N900?
 
Did a test,at first run 30 apps at the same time without sd swap.After that rebooted and created swap in micro sd and run same 3p apps.I noticed that there is a little performance increase.

nightfire 2010-04-03 20:40

Re: Using Micro SD Card as Virtual Ram on Nokia N900?
 
Quote:

Originally Posted by shadowjk (Post 593551)
page-cliuster size is already set to 128k, iirc. It helps at the start, but after some time the swap area has become fragmented enough that swapout becomes more 4k random writes

Oh I meant the RAM page size. I don't know if it's adjustable on the CPU/MMU or not, but with 256k the atomic unit, you could only ever page in/out 256k.


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

vBulletin® Version 3.8.8