Active Topics

 



Notices


Reply
Thread Tools
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#41
@lma
For most, (me including), ramzswap works OK, but doesn't offer any noticeable benefits.

As for ereswap, of course, it provides benefits - after all, "virtual" swap is a gain of only half of ramzswap size (so, for 64 MB ramzswap, You "gain" 32 MB at cost of CPU power), so fragmentation of "real" swap is only delayed.

It could be delayed further, if You would, for prolonged period of time, use less swap than ramzswap size (i.e, in above example, less than 64 MB) - as swap would be appearing and disappearing in environment, where fragmentation *shouldn't* be noticeable (it still occur, but is negated due to speed of RAM) - but every bit written to real swap, brings You closer to hitting painful fragmentation.

BTW, ereswap, by design, *does* consider, that only "real" swap should be counted for swap fragmentation - as long as in config file, You provide locations *only* for real swap (both main and backup), update rcS-late accordingly (via ereswap's scripts), and, if necessary, edit things to enable usage of ramzswap.

Just keep in mind that editing rcS-late by hand invalidate it for using adjust-rcS-late and update-rcS-late - yet, it's not a big deal, as if You know how to edit rcS-late by hand, You actually don't need those two scripts They're mean to "automagically" update rcS-late, saving it from users doing manual changes to file, that is critical for boot process.

/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!

Last edited by Estel; 2012-05-26 at 00:13.
 

The Following User Says Thank You to Estel For This Useful Post:
Posts: 2,802 | Thanked: 4,491 times | Joined on Nov 2007
#42
Originally Posted by Estel View Post
For most, (me including), ramzswap works OK, but doesn't offer any noticeable benefits.

As for ereswap, of course, it provides benefits - after all, "virtual" swap is a gain of only half of ramzswap size (so, for 64 MB ramzswap, You "gain" 32 MB at cost of CPU power), so fragmentation of "real" swap is only delayed.
Hm, curious... on my N810 the difference between swap on MMC/SD vs ramzswap is like night and day. Also the gain is typically more like 2x the amount of RAM used (OrigDataSize/ComprDataSize tends to hover around 3), see sample stats (when really pushing it) here.

Anyway, I was basically wondering whether fragmentation is a significant issue on RAM and whether ereswap-like recycling would make sense in that context. I practically never hit "real" swap (even though I've left it enabled just in case with a lower priority) so that's not a real concern.
 

The Following User Says Thank You to lma For This Useful Post:
Posts: 1,225 | Thanked: 1,905 times | Joined on Feb 2011 @ Quezon City, Philippines
#43
ramzswp does work on the N900, albeit with questionable benefits. I tried a disksize of 64MB, and ended up with massive swap episodes (bigger than the usual ones, and usually resulting in omap-wd rebooting the device) with just the music player and MicroB running.

Perhaps more investigation into kernel tunables may be needed, if it really does benefit low-memory devices trying to run full Linux desktops.
__________________
N9 PR 1.3 Open Mode + kernel-plus for Harmattan
@kenweknot, working on Glacier for Nemo.
 
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#44
Originally Posted by lma View Post
Anyway, I was basically wondering whether fragmentation is a significant issue on RAM and whether ereswap-like recycling would make sense in that context. I practically never hit "real" swap (even though I've left it enabled just in case with a lower priority) so that's not a real concern.
Honestly, I have no idea. It *shouldn't* be a concern, due to speed of RAM, but if kernel is wasting too much "thinking" about where to include pages (= is searching for biggest free continuous blocks gap), who knows... It depends on kernel implementation of writing to swap. On Fremantle, we *shouldn't* get hit by swap fragmentation problem, although, we are. freemangordon suspects wrong implementation of managing writing to swap (after whole swap space is used sequentially), and is investigating possible ways to fix it...

so, maybe we will live to a day, when ereswap won't be needed anymore

/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 4 Users Say Thank You to Estel For This Useful Post:
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#45
Originally Posted by Estel View Post
@lma
For most, (me including), ramzswap works OK, but doesn't offer any noticeable benefits.
Originally Posted by Hurrian View Post
ramzswp does work on the N900, albeit with questionable benefits. I tried a disksize of 64MB, and ended up with massive swap episodes (bigger than the usual ones, and usually resulting in omap-wd rebooting the device) with just the music player and MicroB running.

Perhaps more investigation into kernel tunables may be needed, if it really does benefit low-memory devices trying to run full Linux desktops.
Just wanted to ask in compcache thread about experiences.
For me ramzswap does not work:
OK, i get it loaded and activated (depending on memory status sometimes with instant reboot). And it works, gives some benefit.
BUT only to a point (which is hit very early).
Then big lagging as Hurrian expalined happens, even WD reboots.
I had swap on SD and eMMC enabled, ramzswap/kernel somehow decided to use them both simulatenously, even they had different priorities.
Even when ramzswap enabled with only one of these swap locations (either eMMC or SD) this happened.
I am running kp50, swappolube proposed settings and freemangordon/estel "big-file" settings.
Maybe we can discuss this better in compcache thread or contnue here (it is very realted topic)?
 

The Following User Says Thank You to peterleinchen For This Useful Post:
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#46
Originally Posted by Estel View Post
@lma
Just keep in mind that editing rcS-late by hand invalidate it for using adjust-rcS-late and update-rcS-late - yet, it's not a big deal, as if You know how to edit rcS-late by hand, You actually don't need those two scripts They're mean to "automagically" update rcS-late, saving it from users doing manual changes to file, that is critical for boot process.

/Estel
Estel, during fiddling with multiboot, compcache and recovery shell I found that we do not need to edit system critical files (rcS-late) directly, but we may enable SD swap / disable eMMC swap later safely with script in event.d:
start on started ke-recv is early enough, no data is written to eMMC swap at this point (256MB mem is too less, but to this point sufficient ).
So I modified my scripts to enable ramzswap (priority 1), then SD swap (priority 0) and the disable eMMC swap (priority -1). I do not see any boot delays, except enabling of swap (swapon -a), but this should not consume much time (less than we can measure).
Just for info,
 

The Following 2 Users Say Thank You to peterleinchen For This Useful Post:
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#47
Originally Posted by peterleinchen View Post
Estel, during fiddling with multiboot, compcache and recovery shell I found that we do not need to edit system critical files (rcS-late) directly, but we may enable SD swap / disable eMMC swap later safely with script in event.d:
start on started ke-recv is early enough, no data is written to eMMC swap at this point (256MB mem is too less, but to this point sufficient ).
So I modified my scripts to enable ramzswap (priority 1), then SD swap (priority 0) and the disable eMMC swap (priority -1). I do not see any boot delays, except enabling of swap (swapon -a), but this should not consume much time (less than we can measure).
Just for info,
--
ah, and with latest experiences I have ramzswap disabled until new info/tuning ...
 
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#48
Originally Posted by peterleinchen View Post
So I modified my scripts to enable ramzswap (priority 1), then SD swap (priority 0) and the disable eMMC swap (priority -1).
The best thing is to disable eMMC swap completely via /sbin/swapoff <location of emmc swap>, but anyway, good find. If it's done on point, when no data is written to swpa at all, it shouldn't make any difference in booting time.

Still, do we gain anything by it? If our script is screwed, we will end without swap = system still won't boot, like with screwed settings in rcS-late. Either way, recovery console (in any flavor, be it backupmenu's one or any other) is needed to fix that by hand (or via backup).

I think it's similar effort to (via recovery console) "rm /etc/event.d/custom-screwed-script", and "cp /pah/to/rcS-late.backup /etc/event.d/rcS-late". In fact, when talking about practical side (bootable/unbootable), any script dealing with swap in such way is "critical" to the system.

/Estel
---

I've found something that worry me - sudden of nothing, my device refuse to boot past 5 dots (no reboot loop, just stay with black screen and backlight on forever), unless I remove line:
Code:
blkid -g
...from rcS-late.

It's part of script, that check for existence of swaptype partition in place provided via config... I've idea how to make it more reliable, so i'll release fix in few days (I hope).

What is most strange, though, is that I could swear it worked for me yesterday, and it seems to work for all of You. Still, keep that in mind - if, by any chance, someone got hit by similar problem during boot, just open recovery console (via backupmenu, or any other flavor), mount rootfs, and comment out mentioned line in rcS-late. Unfortunately for me, I had to restore rootfs, until I repeated all steps and got hit by same thing again - only then I realized what is causing problems.

Well, it's -devel after all, and sometimes, packages turn on their creators, eh?

// Edit 2

BTW, out of complete curiosity, if someone got an idea why blkid -g executed from rcS-late makes whole booting process go limbo state, I would appreciate info.

/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!
 
Posts: 1,225 | Thanked: 1,905 times | Joined on Feb 2011 @ Quezon City, Philippines
#49
Originally Posted by peterleinchen View Post
Estel, during fiddling with multiboot, compcache and recovery shell I found that we do not need to edit system critical files (rcS-late) directly, but we may enable SD swap / disable eMMC swap later safely with script in event.d:
The point was to speed up boot by streamlining the swap selection process (and avoid activating eMMC swap then swapping-off a few seconds later).

It should be safe to throw in "if /lib/modules/current/ramzswap.ko insmod /lib/modules/current/ramzswap.ko disksize_kb=65536 swapon -p 5 /dev/ramzswap0" before MMC-device swap detection happens.

However, I would strongly suggest testing out ramzswap options before putting it in. The results people are getting are wildly variable. If the pre-Fremantle guys say it's good, we need to get our kernel tunables just right (avoid everything getting put into ramzswap, and hitting swap+cpu hell, etc)
__________________
N9 PR 1.3 Open Mode + kernel-plus for Harmattan
@kenweknot, working on Glacier for Nemo.
 
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#50
Originally Posted by Estel View Post
The best thing is to disable eMMC swap completely via /sbin/swapoff <location of emmc swap>, but anyway, good find. If it's done on point, when no data is written to swpa at all, it shouldn't make any difference in booting time.

Still, do we gain anything by it? If our script is screwed, we will end without swap = system still won't boot, like with screwed settings in rcS-late. Either way, recovery console (in any flavor, be it backupmenu's one or any other) is needed to fix that by hand (or via backup).

I think it's similar effort to (via recovery console) "rm /etc/event.d/custom-screwed-script", and "cp /pah/to/rcS-late.backup /etc/event.d/rcS-late". In fact, when talking about practical side (bootable/unbootable), any script dealing with swap in such way is "critical" to the system.
/Estel
True!
Wanted that to add to/edit
my post, but battery died and I needed sleep. So you were faster

Originally Posted by Hurrian View Post
The point was to speed up boot by streamlining the swap selection process (and avoid activating eMMC swap then swapping-off a few seconds later).

It should be safe to throw in "if /lib/modules/current/ramzswap.ko insmod /lib/modules/current/ramzswap.ko disksize_kb=65536 swapon -p 5 /dev/ramzswap0" before MMC-device swap detection happens.

However, I would strongly suggest testing out ramzswap options before putting it in. The results people are getting are wildly variable. If the pre-Fremantle guys say it's good, we need to get our kernel tunables just right (avoid everything getting put into ramzswap, and hitting swap+cpu hell, etc)
Exactly what I did in /sbin/multiboot, so I even had the cahnce to disable activation completely by booting with keyboard out.

Speed of enabling disablingswap is just micro or milli. as long as no data needs to be transferred. But also true.

Just another flavor!


About ramzswap
I do not recommend anyone to use ramzswap at all. Neither to use swapset (even there is bug in code that does not enable ramzswap at all).
 
Reply

Tags
ereswap, fragmentation, microsd, swappiness, swaps


 
Forum Jump


All times are GMT. The time now is 20:35.