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)

sixwheeledbeast 2012-07-16 18:14

Re: [DISCUSS] SDCard Swap Partition Methods..
 
True a GUI would be good that's why I started one, but it needs a lot of work.

Automatic Re-swapping can cause problems if your in the middle of something.

My method has a separate event.d file (which I personally prefer over editing rcS-late)

The two scripts you mention in your method are the same as Ereswap (currently in devel) wiki.maemo.org/Ereswap

My method has one script to switch swap (automatically forcing onto uSD if not already)
The other script is to switch to internal swap so the uSD/back cover can be removed.
If you have Swap on uSD removing the back cover will (in the words of vi_) insta-unmount your swap, which is like pulling a RAM stick out of a desktop. My script is useful for if I need to get in the back while powered up.

IIRC (from something I read on TMO) the swapon/swapoff is better done with the N900 unlocked.

OMOIKANE 2012-07-17 12:36

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

Originally Posted by peterleinchen (Post 1237164)
I do not have the truth for you, just assumption, that disabling eMMC swap for some N900s leads to unpredictable behaviour.
Please see my posts in compcache/ramzwap thread.

Thanks. But glitch is disappears after setting 768 mb swap partition on SD.
Was 384.

peterleinchen 2012-07-17 21:04

Re: [DISCUSS] SDCard Swap Partition Methods..
 
But there is no reason for "glitch" to disappear :confused:
I have atm another SD card with real partition and my glitch appeared again once, but only once. It is a class 2 card, whereas the other was/is a class4.
So totally confusing...

misiak 2012-07-18 06:40

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

Originally Posted by OMOIKANE (Post 1238696)
Thanks. But glitch is disappears after setting 768 mb swap partition on SD.
Was 384.

Quote:

Originally Posted by peterleinchen (Post 1238966)
But there is no reason for "glitch" to disappear :confused:
I have atm another SD card with real partition and my glitch appeared again once, but only once. It is a class 2 card, whereas the other was/is a class4.
So totally confusing...

Fremantle was designed to run with 1 gb ram, if OMOIKANE had 384 swap, it was 640mb alltogether, I think this was the case (as changing it back to 768 = 1gb alltogether) made it work again.

OMOIKANE 2012-07-18 07:33

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

Originally Posted by peterleinchen (Post 1238966)
But there is no reason for "glitch" to disappear :confused:
I have atm another SD card with real partition and my glitch appeared again once, but only once. It is a class 2 card, whereas the other was/is a class4.
So totally confusing...

I dunno why but 384 and 512 linux-swaps leads to that glitch - "appname-resuming" on top and reloading the page.
My sdcard is class 10.
Also I can open (with 384 mb swap) 8-9 pages only in microb. After that system tells me about "pause and low memory". But conky shows about 100 mb of swap usage.

sixwheeledbeast 2012-07-18 17:15

Re: [DISCUSS] SDCard Swap Partition Methods..
 
It's seems silly to make your swap smaller than the standard 768mb.

I would be using between 3-4 times RAM amount upto 4GB swap, then on larger desktops over 4GB, 1:1 ratio is usually more than enough.

Too much and too little will only cause problems.

Estel 2012-07-20 11:41

Re: [DISCUSS] SDCard Swap Partition Methods..
 
This is known glitch - 600 or more swap is sufficient for having everything working OK, but no less.

Of course, using 1.5GB swap (or more) makes it *much* more comfortable, as times between required reswaps increase considerably.

BTW, I've just grasped real SanDisk class 4 microSD 32GB (for 17 USD :D), so I'm going to exploit big swaps very soon ;)

/Estel

peterleinchen 2012-07-20 20:31

Re: [DISCUSS] SDCard Swap Partition Methods..
 
ORLY?

Did not know that, thanks. Some more info/link to that?

But it does not explain my SGX-alike UI-total-freezes, as I always had 768 MB on SD. And these freezes just came up when I had my eMMC swap fully disabled. Now I again have it online with lesser priority and everything is fine again (yippie).
Code:

~# cat /proc/swaps
Filename                                Type                Size        Used        Priority
/dev/mmcblk0p3                          partition        786424        12680        -1
/dev/mmcblk1p3                          partition        786424        261084        2


sixwheeledbeast 2012-07-22 19:12

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

Originally Posted by peterleinchen (Post 1237913)
Sure there is. Here, for your convenience ;)
Code:

if [ `id -u` != 0 ] ; then
      exec sudo gainroot <<EOF
exec sh $0 $*
EOF
      exit $?
fi


Thanks had to make a small change to get it working tho.

Code:

if [ `id -u` != 0 ] ; then
      exec | sudo gainroot <<EOF
exec sh $0 $*
EOF
      exit $?
fi

Updated my scripts on the discussion page
Although this "gainroot" script seems to make the banner repeat twice on the eject sd script, not sure how to fix.

I don't think large swaps have a benefit.
When fragmentation occurs, swapoff will take forever.

peterleinchen 2012-07-22 21:55

Re: [DISCUSS] SDCard Swap Partition Methods..
 
@sixwheeledbeast

Did not yet check your scripts completely, but for the multiple banner I do have explanation:
please check out last line of my template
Code:

#!/bin/sh
# executing a shell script given as parameter(s) as root

if [ `id -u` != 0 ] ; then
      exec sudo gainroot <<EOF
exec sh $0 $*
EOF
      exit $?
fi

# own shell code from here

You have to type your code below that line, as this will detect if you already have root privileges or not and call the script again with su privileges. so everything above that will be executed twice.

And for need to change the code by you. I never had the need as i always followed the above rule. So change back, put everything below and test again.

About
Quote:

I don't think large swaps have a benefit.
When fragmentation occurs, swapoff will take forever.
I think you are wrong. Only amount of swap data in use, i.e. what conky (cat /proc/swaps) shows, will be moved. So bigger swap parts will help to minimze swap refresh actions, as time until fragmentation starts, will increase.
(did not test yet, but am pretty sure)


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

vBulletin® Version 3.8.8