Reply
Thread Tools
Posts: 1,427 | Thanked: 2,077 times | Joined on Aug 2009 @ Sydney
#11
Yeah, this will allow memory hungry apps to at least "run" but not "fast". Still good to know. =)
 

The Following User Says Thank You to jakiman For This Useful Post:
Posts: 1,258 | Thanked: 672 times | Joined on Mar 2009
#12
The 10megabytes/sec speed is only achieved with large sequential access. Random writes access, which swapping is, yields less than 1 megabyte/s in most cases, and worst case it degrades to less than 100kbyte/s. SD/mmc storage isn't designed for random access
 

The Following 3 Users Say Thank You to shadowjk For This Useful Post:
Posts: 3,841 | Thanked: 1,079 times | Joined on Nov 2006
#13
Be careful with terminology, folks.

o RAM: RAM is always physical RAM. In the N900 there's 256MB of it.
o There's no such thing as 'virtual RAM'.
o Swap space: Resides in the built-in flash storage (there's 768MB of it on the N900), or could be set up on microSD as well).
o Virtual memory: This is (on Linux) the sum of swap and RAM. On the N900 it's 1GB (768+256).

Virtual memory is what the applications can potentially use (not considering some limitations added by the kernel). Virtual memory is the only thing applications know about. If you have no swap space allocated, only the 256MB physical RAM, then your virtual memory size would be 256MB. There's no such thing as 'not having virtual memory set up'. You mean _swap_ here.

o Swap space is always slower than RAM. Maybe in the future this could change, when/if some of the stuff being worked on in the labs manifests itself. Then maybe we'll have RAM, SD cards, USB sticks, other mass storage, all built from the same magical, non-volatile, super-fast stuff.

o Adding swap will not make for a faster device, only for a device which can sustain more applications running at the same time, or using more data, without going down in flames. There was a myth, for a while, that the N800 and N810 would be faster if you enabled swap space. This was only in the imagination - I tested this. And there's no rational reason it should be faster, except in very carefully thought out scenarios that won't happen with normal use.

o Adding excessive amounts of swap _will_ make your device slower, eventually. Particularly if you keep your applications (e.g. browser) running at all times.
__________________
N800/OS2007|N900/Maemo5
-- Metalayer-crawler delenda est.
-- Current state: Fed up with everything MeeGo.

Last edited by TA-t3; 2010-01-27 at 15:33. Reason: Typo
 

The Following 30 Users Say Thank You to TA-t3 For This Useful Post:
Posts: 150 | Thanked: 93 times | Joined on Oct 2009 @ Pennsylvania, US
#14
@TA-t3: Good info. Sometimes I forget that these things aren't always so clear to everyone...
 
Posts: 310 | Thanked: 383 times | Joined on Jan 2010
#15
If anyone is curious, I submit that moving your swap to your microsdhc card dramatically increases performance. It offloads swap I/O from the internal MMC, which frees it up for concurrent access (ie. program/library loading).

I created a 512mb slice on my microsd card, and modified the boot scripts to use it instead (excluding the 768mb mmc swap area completely) and the device is significantly more responsive when you have more than a few processes running.

This should be an option out-of-the-box (assuming the user is fairly warned about being unable to eject the microsdhc card while running).

Also note that you need a separate partition; a swap file seems to lock /sbin/swapon (bug?), and in any case you'd lose the ability to mount the vfat partition via USB (filesystem in use).

Last edited by nightfire; 2010-03-22 at 04:49.
 

The Following 5 Users Say Thank You to nightfire For This Useful Post:
Posts: 716 | Thanked: 303 times | Joined on Sep 2009 @ Sheffield, UK
#16
Originally Posted by nightfire View Post
If anyone is curious, I submit that moving your swap to your microsdhc card dramatically increases performance. It offloads swap I/O from the internal MMC, which frees it up for concurrent access (ie. program/library loading).

I created a 512mb slice on my microsd card, and modified the boot scripts to use it instead (excluding the 768mb mmc swap area completely) and the device is significantly more responsive when you have more than a few processes running.

This should be an option out-of-the-box (assuming the user is fairly warned about being unable to eject the microsdhc card while running).

Also note that you need a separate partition; a swap file seems to lock /sbin/swapon (bug?), and in any case you'd lose the ability to mount the vfat partition via USB (filesystem in use).
Except, the most common programs/libraries are stored on the root partition, which is its own dedicated much faster flash memory built-in to the CPU package.

Only optified programs are stored on the eMMC, the same flash chip used for swap. So it should only make a difference in certain very specific circumstances. There is also a question of how the bus works in the N900, for all we know the microSD and eMMC have to contend for the same bandwidth.

Obviously that does not explain your positive results of moving the swap to microSD though. I usually find the N900 far more responsive after a reboot anyway, so are you sure you are not mistaking fresh boot speediness for swap speed improvement?

If it does help though, why not keep both swap partitions? Surely it being able to stripe between two separate devices should be even faster still?
__________________
http://www.speedtest.net/result/877713446.png

My Websites
CSD Projects - Flickr - UAE4Maemo (UAE4All Compatibility List)

Favourite N900 Applications
Picodrive - UAE4All

Please post your UAE4All compatibility reports. Even better, post them to my UAE4Maemo site!
Not sure how UAE4All works such as mouse emulation? Read the FAQ.

Last edited by Alex Atkin UK; 2010-03-22 at 06:23.
 

The Following 2 Users Say Thank You to Alex Atkin UK For This Useful Post:
Posts: 120 | Thanked: 33 times | Joined on Jan 2010
#17
Originally Posted by nightfire View Post
If anyone is curious, I submit that moving your swap to your microsdhc card dramatically increases performance. It offloads swap I/O from the internal MMC, which frees it up for concurrent access (ie. program/library loading).

I created a 512mb slice on my microsd card, and modified the boot scripts to use it instead (excluding the 768mb mmc swap area completely) and the device is significantly more responsive when you have more than a few processes running.

This should be an option out-of-the-box (assuming the user is fairly warned about being unable to eject the microsdhc card while running).

Also note that you need a separate partition; a swap file seems to lock /sbin/swapon (bug?), and in any case you'd lose the ability to mount the vfat partition via USB (filesystem in use).
Please share all the steps to configure this!

Would the striping idea work? It certainly seems logical.
 
Posts: 170 | Thanked: 24 times | Joined on Nov 2009
#18
Speed depends on SD Class class 6 and class 10 are the fastest at the moment but there is only class 6 micro sd cause class 10 was just released
 
demiurgus's Avatar
Posts: 40 | Thanked: 86 times | Joined on Dec 2009 @ Sweden
#19
Originally Posted by byte_76 View Post
Would the striping idea work? It certainly seems logical.
There is no need to configure striping for swap partitions. If you have more than one the kernel will use them interchangeably anyway.
 
Posts: 310 | Thanked: 383 times | Joined on Jan 2010
#20
Good point on rootfs being on a separate partition. I do run a lot of optified apps, and many apps access a lot of files in ~ (though small, still wait in the queue during heavy swap I/O).

My uptime's ~6 days right now and I have 8 apps running, and it's showing no signs of slowing down. Everything is still lightning fast. My microsd card is a 4gb sandisk. Not sure the class, but maybe it is faster at the block size the swap is using. I should check that. I did a quick I/O test with dd/sync, and it seemed to be slightly slower than the internal MMC. I should retest with more granularity.

I can write up a howto as soon as I get to the office. It's pretty straightforward.

I'll also note some program load / switch times for reference and comparison.
 

The Following 2 Users Say Thank You to nightfire For This Useful Post:
Reply


 
Forum Jump


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