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)

stlpaul 2010-09-02 19:07

Re: Using Micro SD Card as Virtual Ram on Nokia N900?
 
I installed gparted in easy debian & used it to easily resize and repartition my SD card directly on my N900. What other phone can do that?? :)

j.s 2010-09-02 19:22

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

Originally Posted by stlpaul (Post 805559)
I installed gparted in easy debian & used it to easily resize and repartition my SD card directly on my N900. What other phone can do that?? :)

openmoko freerunner

egoshin 2010-09-02 19:34

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

Originally Posted by x-rated (Post 805184)
Hi!

Was wondering about my N900 often being very slow and unresponsive

Kill trackerd and use KMPlayer instead of system media player -

tracker-process -t

vivek5000 2010-09-05 05:53

Re: Using Micro SD Card as Virtual Ram on Nokia N900?
 
I have a 16GB memory Card. How do I use it as additional ram for N900?

If I want to use only 1GB, 2GB or 4GB as additional ram & remaining functions of the memory card, how do I do it?

Is there any noticeable difference in the performance after using MicroSD space as ram?

Please help.

GameboyRMH 2010-09-06 11:54

Re: Using Micro SD Card as Virtual Ram on Nokia N900?
 
You're not really using the microSD space as RAM, you're using it as swap space. You can partition as much or as little space as you want. The performance improvement isn't huge, it's just a little faster.

http://wiki.maemo.org/Swap_on_microS...d_for_swapping

tomast 2010-09-06 12:29

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

Originally Posted by x-rated (Post 805184)
Hi!
mkswap /dev/mmcblk1p1 #prepare the swap partition
swapon /dev/mmcblk1p1 #enable the swap partition

Haven't done this, but should be /dev/mmcblk1p2 I guess!

x-rated 2010-09-07 10:46

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

Originally Posted by tomast (Post 808581)
Haven't done this, but should be /dev/mmcblk1p2 I guess!

Yep, changed, thanks!

Still started to get unresponsive after a couple of days so checked what's going on. Seems that the new partition will by default have lower priority than the internal one so it would be used only after the internal swap is exhausted, no added performance. The default BusyBox swapon doesn't even support setting the priority so would need to set the swap partition in the fstab (either somehow commanding how it's generated or editing between generating and taking in use), or using a proper swapon command.

Luckily Easy Debian happens to have a proper swapon which makes testing easier and pretty risk-free:

(Run Debian chroot)
[root@deb-m5v3d: ~]swapoff /dev/mmcblk1p2 # Turn off uSD swap
[root@deb-m5v3d: ~]swapon -p 0 /dev/mmcblk1p2 # Turn on uSD swap with priority 0
[root@deb-m5v3d: ~]swapoff /dev/mmcblk0p3 # Turn off internal swap (might take some time as it'll need to copy stuff to the other swap partition)
[root@deb-m5v3d: ~]swapon -p 0 /dev/mmcblk0p3 # Turn on internal swap with priority 0
[root@deb-m5v3d: ~]swapon -s # Check the status
Filename Type Size Used Priority
/dev/mmcblk0p3 partition 786424 236 0
/dev/mmcblk1p2 partition 393584 120276 0


There we go, both swap partitions used. Let's try a fresh start and then opening some apps and web pages (/proc/swaps can be used both native and with Easy Debian):

Nokia-N900:~# cat /proc/swaps
Filename Type Size Used Priority
/.debian/dev/mmcblk0p3 partition 786424 87728 0
/.debian/dev/mmcblk1p2 partition 393584 89360 0


Looks nicely balanced between the partitions.

And how's swap space activity by Easy Debian iostat:

avg-cpu: %user %nice %system %iowait %steal %idle
32.49 3.54 25.29 18.61 0.00 20.07

Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
mmcblk1 136.89 3026.79 1179.79 182152 71000
mmcblk1p1 0.00 0.00 0.00 0 0
mmcblk1p2 136.89 3026.79 1179.79 182152 71000
hdq10 169.18 340.81 0.86 20510 52
hdq4 0.00 0.00 0.00 0 0
hdq2 0.00 0.00 0.00 0 0
mmcblk0 203.95 4405.68 1212.75 265134 72983
mmcblk0p1 0.90 63.91 0.12 3846 7
mmcblk0p2 57.86 1278.70 34.56 76952 2080
mmcblk0p3 145.20 3063.08 1178.07 184336 70896

Lot's of swap activity but perfectly balanced and only 18.61% I/O waits, looks good.

Let's see how will it look like after some days uptime now.

Anyone know if fstab generation could be configured somehow?

GameboyRMH 2010-09-07 12:42

Re: Using Micro SD Card as Virtual Ram on Nokia N900?
 
Hmm interesting. I wonder if there's a way to set swap files with equal priority without using Easy Debian's swapon. It would be nice to be able to do this in a startup script that you won't have to worry about it breaking if Easy Debian is removed / gets messed up somehow. Plus mounting the chroot during startup and copying swap content back and forth would bog things down quite a bit.

Me might need someone to port the GNU swapon/swapoff tools to Maemo 5...

somekeystrokes 2010-09-18 03:55

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

Originally Posted by rewt (Post 496825)
For those who need more VM, and wish to use their entire MicroSD card for this purpose:

(WARNING: This will erase the entire MicroSD card, or worse, some or all of your internal memory if you mistype the device name.. If you plan to proceed, I recommend that you have some idea what you are doing)

In x-term:

Code:

sudo gainroot
mkswap /dev/mmcblk1p1
swapon /dev/mmcblk1p1

The last line will have to be rerun each time your device is rebooted, unless you add an init script to run it.

the last line seems to give me an error saying invalid argument!
:(
what to do?
I have a 4gb card!

somekeystrokes 2010-09-18 15:33

Re: Using Micro SD Card as Virtual Ram on Nokia N900?
 
No inputs frm anybdy?


All times are GMT. The time now is 16:06.

vBulletin® Version 3.8.8