View Single Post
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#2
Single swap on SD card is definitely better way to go, as it don't create I/O conflicts between Maemo /home/ and swap. It's even better than stripping swap between eMMc and SD card - speed benefits are quite a myth, as conflicts eat any benefit + add overhead (flash media doesn't handle many independent request very efficiently).

As for method of setting it permanently - script in /etc/event.d isn't bad thing - especially, that in case of problems, there are methods (haven't tried myself) to delay executing such scripts. Ho ever, it makes boot slower, as - technically - Maemo first enable eMMC swap, then, due to our script, enable SD swap and disable eMMC swap. It's unnecessary operation.

So, best way, if You're absolutely sure that it's what You want, is to edit /etc/event.d/rcS-late, replacing line:
Code:
swapon -a
...with

Code:
swapon /dev/mmcblk1p2
...if Your swap partition is 2nd partition on SD card. In other case, modify /dev/mmcblk*p* accordingly, replacing * with correct numbers.

This way, swap on microSD is enabled during boot process without any additional overhead, and eMMC swap partition isn't used at all. You may reclaim it's space by repartitioning, or keep it as backup solution (I keep 100 MB backup swap on eMMC for purpose of "refreshing" swap partition, which I'll elaborate more later).

As for swap settings mentioned in thread linked in 1st post, [b]freemangordon[/]'s ones are surely more bleeding-edge - mine are more similar to stock settings, yet I'm very satisfied with results (I'm trying to find balance between freemangordon's ones and stock ones, and it seems to be that). Most of things set there can be edited by swappolube, although, not all of them. Remember, that setting them via echo modify it only until next reboot - to set it permanently, one should add it to some script in /etc/event.d/ (setting it here is much faster than enabling&disabling swap, so difference in booting time shouldn't be noticed), or do ti exactly as swappolube does it (how?).

That's the basics. Very important thing is preventing swap fragmentation via swap reflesh - I've modified shadowjk's scripts to make it bulletproof solution, and liked to publish it long time ago - well, IU hoped for doing it convenient way via a repos, but publishing here for pre-audit may be a good idea.

I'll post it and elaborate more about it on later time.

/Estel
__________________
N900's aluminum backcover / body replacement
-
N900's HDMI-Out
-
Camera cover MOD
-
Measure battery's real capacity on-device
-
TrueCrypt 7.1 | ereswap | bnf
-
Hardware's mods research is costly. To support my work, please consider donating. Thank You!
 

The Following 22 Users Say Thank You to Estel For This Useful Post: