Reply
Thread Tools
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#91
Just wait until current swap usage reaches its limit (with some safety margin, e.g. 10% of swap).So start dis-/enabling just shortly before switching.
And do it with lesser nice, like
'nice -20 switchswap.sh'
 

The Following User Says Thank You to peterleinchen For This Useful Post:
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#92
Worth checking in practice - if dis/ena/-bling, at this point, would be very quickly, it could be done in background, automatically, without user's intervention at all.

OTOH, I've talked with ShadowJK on IRC about that, and he mentioned, that having fragmented swap with lower priority (as when enabling 2nd swap with higher priority, without disabling 1st one), won't work well, as due to flawed implementation, there are still writes occurring on lower-priority (=fragmented) swap:

http://mg.pov.lt/maemo-irclog/%23mae...07-13T23:50:36

/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:
Posts: 2,290 | Thanked: 4,133 times | Joined on Apr 2010 @ UK
#93
OK your RANDOM part makes sense now, probably not required tho.

Originally Posted by malkavian View Post
Great!
What do you think of my version of scripts on the wiki page?
Do they work for everyone?

Originally Posted by malkavian View Post
Great solution... ops, more work to do XDDD.
On that note anybody looking for more work to do check out this.
I started a GUI for ereswap but it got well out of my league.
Feel free to take the reigns on the project.
__________________

Wiki Admin
sixwheeledbeast's wiki
Testing Squad Subscriber
- mcallerx - tenminutecore - FlopSwap - Qnotted - zzztop - Bander - Fight2048 -


Before posting or starting a thread please try this.
 

The Following User Says Thank You to sixwheeledbeast For This Useful Post:
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#94
Originally Posted by Estel View Post
...
that having fragmented swap with lower priority (as when enabling 2nd swap with higher priority, without disabling 1st one), won't work well, as due to flawed implementation, there are still writes occurring on lower-priority (=fragmented) swap:
...
Yes, true about small amount of writing to low-priority swap, but really small amount.
And, this swap is not yet fragmented, as we start switchswap about 10% (or similar) before maximum reached.
Then it should work flawlessly.

I did not have any negative effects with my setup (main swap on SD with eMMC always on with lower priority; dis-/reenabling SD swap after 700MB written).
 

The Following User Says Thank You to peterleinchen For This Useful Post:
Posts: 461 | Thanked: 358 times | Joined on May 2010 @ Bilbao (Basque Country [Spain])
#95
Originally Posted by sixwheeledbeast View Post
What do you think of my version of scripts on the wiki page?
Do they work for everyone?
Well, scripts look nice, but maybe "sudo" won't work for everybody. Mines must be used as root.

Originally Posted by sixwheeledbeast View Post
I started a GUI for ereswap but it got well out of my league.
Feel free to take the reigns on the project.
Out of my league too :S.
 

The Following User Says Thank You to malkavian For This Useful Post:
Posts: 461 | Thanked: 358 times | Joined on May 2010 @ Bilbao (Basque Country [Spain])
#96
Originally Posted by Estel View Post
due to flawed implementation, there are still writes occurring on lower-priority (=fragmented) swap:
Ummm, and I am thinking that there isn't a command to modify swap priorities without disabling and re-enabling it. Altought the lower priority possible is 0 and the higher 32767, so we would have long time to increase priorities XD. We'd be able to to 32767 swap refreshings before having problems.
 

The Following User Says Thank You to malkavian For This Useful Post:
Posts: 2,290 | Thanked: 4,133 times | Joined on Apr 2010 @ UK
#97
Originally Posted by malkavian View Post
Well, scripts look nice, but maybe "sudo" won't work for everybody. Mines must be used as root.
I was thinking this I have sudser installed. I suppose the better way is to remove the sudo part of the script and call the script with
Code:
run-standalone.sh /home/user/.myscript/swapswitch.sh | sudo gainroot
Edit--

I am certain I have seen some script that is
"if not root - sudo me"
__________________

Wiki Admin
sixwheeledbeast's wiki
Testing Squad Subscriber
- mcallerx - tenminutecore - FlopSwap - Qnotted - zzztop - Bander - Fight2048 -


Before posting or starting a thread please try this.

Last edited by sixwheeledbeast; 2012-07-14 at 15:36.
 

The Following User Says Thank You to sixwheeledbeast For This Useful Post:
Posts: 1,203 | Thanked: 3,027 times | Joined on Dec 2010
#98
i've seen several posts here regarding problems with swap implementation and multiple swap locations/files. are there any patches from meego/mainline we could backport to help?
 
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#99
Originally Posted by malkavian View Post
Ummm, and I am thinking that there isn't a command to modify swap priorities without disabling and re-enabling it.
Unfortunately yes. But for real defragmenting you still need to dis-/reenable the swap location.

Originally Posted by sixwheeledbeast View Post
I am certain I have seen some script that is
"if not root - sudo me"
Sure there is. Here, for your convenience
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
 

The Following 7 Users Say Thank You to peterleinchen For This Useful Post:
Posts: 26 | Thanked: 39 times | Joined on Jul 2012 @ Bulgaria
#100
Hey guys, I got intrested in the swap switching idea that you have and i'm currently testing it (thou without the scripts, I prefer doing it manualy 'till i'm in testing phase) ..anyway I have few suggestion:

1. As you already said, it needs GUI ... not that i'm really good at GUI programming ...i kind of hate writing GUI stuff, but i'll try to find some free time to help out with that.
2. Adding the possability of automatic reswaping.
3. Don't edit startup scripts! It's a bad idea.... it think it will be better if you add the (or switch to) second swap at a later stage (maybe after Xstart with sleep for $user_defined seconds before X an then doing it) This way you'll only add dbus scripts.
4. Some changes in the scripts..... first one shoud only check if it is time to do the reswaping, and call the seconds one (if needed). The second one will do the actual reswaping. (not sure but I think that currently both scripts can do some of the same stuff, correct me if i'm wrong.... i'm to lazy to check it out right now)
5. About the automatic reswaping... one way to go is to start a script after phone is locked, sleep for 3-4-5 minutes (this can be user defined too) then check if the load is below some value (for example 0.5) and start reswaping if it is time. if the load is grater -> loop on the sleep and check again. Ofc kill the script on phone unlock.


Anyway those are just my thoughts on the matter, tell me what you think and (if any) with what can I help
 

The Following 3 Users Say Thank You to l4m3rx For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 13:32.