maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   [DISCUSS] SDCard Swap Partition Methods.. (https://talk.maemo.org/showthread.php?t=84296)

peterleinchen 2012-11-22 23:17

Re: [DISCUSS] SDCard Swap Partition Methods..
 
@mr_pingu
Why do you do it every night?
I do it as my swap reaches (configurable) threshold of swap size. So I just swap when needed, start swap action with nice 19 and it lags abit, but it is fully okay/respondable (OK, you should not try to open multiple browser windows at that time, swapping swap space takes a few minutes ...).

Xagoln 2012-12-20 23:27

Re: [DISCUSS] SDCard Swap Partition Methods..
 
Can anyone confirm that larger swap partitions > 1 GB? 2 GB? actually have a performance benefit that compensates for the loss of MMC space?

Edit: I mean, does it provide a noticeable increase in the length of time between needing to defrag swap?

impeham 2012-12-21 08:58

Re: [DISCUSS] SDCard Swap Partition Methods..
 
yes it does - i moved to 1.5GB and there is a need for much less cycles

Xagoln 2013-01-03 00:44

Re: [DISCUSS] SDCard Swap Partition Methods..
 
Thanks! Just by coincidence, I made the swap partitions on both of my N900s 1.5 GB each before receiving your reply :)

Val Demar 2013-02-07 05:56

Re: [DISCUSS] SDCard Swap Partition Methods..
 
There is a lot of useful info in this thread, I read through most of it but still unclear about the best solution for enabling swap on microsd with fallback to emmc when it is not available at boot time. Will using both giving higher priority to microsd do the trick? My main concern is if I run swap on microsd xclusively and it dies or somehow is unavailable the device won't boot making impossible to take a corrective action.

michaaa62 2013-02-07 08:46

Re: [DISCUSS] SDCard Swap Partition Methods..
 
The simplest setup for me is to have swap on an external microSD card, which i never take out. If it dies, i would just format another card to have a temporary swap on the partition i assigned in /etc/event.d/rcS-late.
For more complex setup, you could search for ereswap application http://talk.maemo.org/showthread.php...hlight=ereswap

sixwheeledbeast 2013-02-07 13:14

Re: [DISCUSS] SDCard Swap Partition Methods..
 
Quote:

Originally Posted by Val Demar (Post 1321274)
My main concern is if I run swap on microsd xclusively and it dies or somehow is unavailable the device won't boot making impossible to take a corrective action.

Quick reply in lunch break...

This is incorrect if you setup the correct things at boot time, which you have to do anyway.

Ereswap modifies rcs-late to force swap to sd (if available).
FlopSwap has an optional checkbox this adds/removes a file in event.d, (IMO better than modifing rcs-late) this again pushes swap to sd at boot if available.
Both programs fallback to device swap if not available.

For more information lookup...
Flopswap, Ereswap, Swap on micro SD, The perfect N900 setup pages at wiki.maemo.org

mr_pingu 2013-02-07 13:53

Re: [DISCUSS] SDCard Swap Partition Methods..
 
Quote:

Originally Posted by peterleinchen (Post 1297390)
@mr_pingu
Why do you do it every night?
I do it as my swap reaches (configurable) threshold of swap size. So I just swap when needed, start swap action with nice 19 and it lags abit, but it is fully okay/respondable (OK, you should not try to open multiple browser windows at that time, swapping swap space takes a few minutes ...).

Seems I never responded to this one... You seem to manually swap it? Or have you written a script to automatically swap when threshold is reached? That way it wouldn't

The way I set this up, you never have to bother to swap manually, all will be done at night when I am sleeping. Also you (Atleast I do) never reach the threshold in 1 day so your phone is responsive, even after longer uptime :)

Said short: Set it up once, never bother anymore, it just works. That's why I prefer ereswap over FlopSwap.. Besides I dont have 3 swap partitions. However the way FlopSwap goes, is cleaner than Ereswap's way...

Estel 2013-02-07 15:18

Re: [DISCUSS] SDCard Swap Partition Methods..
 
It's true, that adding separate script on /etc/event.d/ is "cleaner", in a way that it have less chances or messing something up (not that I've heard about ereswap breaking anyone's rcS-late, ever, but there are always chances), or is just easier for manual managing. It's generally perceived, that touching default, boot-critical scripts - like rcS-late - is less "clean" way of doing things, and I absolutely agree with this.

Hoever, without modifying rcS_late, we have situation, where one script enables regular swap on eMMC, and another one disables it, just a moment later. It makes booting a little longer due to unnecessary operation being performed (although, in practice, it's hardly-to-non noticeable), but most importantly, just don't match my aesthetic, and can create problems, if one decide to go without any eMMC swap, at all.

That's why I've decided to go with the way of sed-modifying rcS-late, which was paincfully more hard to write, than just adding another script to /etc/event.d/, especially, that they way sed command was written, tries to be compatible with modified rcS-late's, too (unless the very swap lines vere touched, but in that case, one wouldn't need ereswap, probably).

After all, we have major respected packages touching boot-critical script - including things from CSSU - so why should we restrain ourselves :D

/Estel

sixwheeledbeast 2013-02-07 17:07

Re: [DISCUSS] SDCard Swap Partition Methods..
 
Quote:

Originally Posted by mr_pingu (Post 1321385)
Said short: Set it up once, never bother anymore, it just works. That's why I prefer ereswap over FlopSwap.. Besides I dont have 3 swap partitions. However the way FlopSwap goes, is cleaner than Ereswap's way...

FlopSwap can be intrgated into cron/alarmd to run on a schedule if required. It's covered in the wiki.
I prefer to run everything on the card to reduce flash wear as I have said before.
While I agree FlopSwap is more restrictive in some ways (swap locations), it is designed to install and remove cleanly with no residue like applications IMO should.

This also makes it more user friendly hence the GUI, not a command tool like ereswap. Many beginners can utilise swap on SD with minimal knowledge using FlopSwap.

This is why I made FlopSwap instead of a GUI for ereswap.

Quote:

Originally Posted by Estel (Post 1321408)
It's true, that adding separate script on /etc/event.d/ is "cleaner", in a way that it have less chances or messing something up

Agreed hence my design.

Quote:

Originally Posted by Estel (Post 1321408)
Hoever, without modifying rcS_late, we have situation, where one script enables regular swap on eMMC, and another one disables it, just a moment later. It makes booting a little longer due to unnecessary operation being performed (although, in practice, it's hardly-to-non noticeable), but most importantly, just don't match my aesthetic, and can create problems, if one decide to go without any eMMC swap, at all.

Change in boottime is milliseconds.
FlopSwap is not designed to work with no device SD.
The device SD can be swapped to, so the back cover can be removed. Not everyone has modifed the magnet on the back cover.

Quote:

Originally Posted by Estel (Post 1321408)
That's why I've decided to go with the way of sed-modifying rcS-late, which was paincfully more hard to write, than just adding another script to /etc/event.d/, especially, that they way sed command was written, tries to be compatible with modified rcS-late's, too (unless the very swap lines vere touched, but in that case, one wouldn't need ereswap, probably).

This is were modifing rcs-late can cause problems, and would cause a boot loop if rcs-late fails.
If the extra event.d file fails it would be ignored and booting should continue on device swap.

Quote:

Originally Posted by Estel (Post 1321408)
After all, we have major respected packages touching boot-critical script - including things from CSSU - so why should we restrain ourselves :D

CSSU fair enough, these are"system" updates, but IMO applications shouldn't just start modifing root and adding files everywhere. This is how root starts to get full of unremovable rubbish, for people that have NFC.

At the end of the day it's nice to have options. :)
Both do the same thing and both have there place.


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

vBulletin® Version 3.8.8