Reply
Thread Tools
Posts: 461 | Thanked: 358 times | Joined on May 2010 @ Bilbao (Basque Country [Spain])
#81
@sixwheeledbeast

This is not javascript, you can't simple equal a function to a variable.

Here you have your scripts corrected and improved I think. If you don't understand something of the code, just ask

Edited to upload a corrected scripts. swapswitch.sh had some stupid errors, I let spaces in assignations between "new" variable the equal and the value. swapswitchejectsd.sh some stupid too but long to explain.
Attached Files
File Type: gz swapswitch.sh.tar.gz (776 Bytes, 77 views)
File Type: gz swapswitchejectsd.sh.tar.gz (621 Bytes, 65 views)

Last edited by malkavian; 2012-07-12 at 23:57.
 

The Following 6 Users Say Thank You to malkavian For This Useful Post:
Posts: 669 | Thanked: 433 times | Joined on May 2010
#82
I just increased the SD's swap size to 1.5GB instead of just 768MB in order to increase the time needed between reswap operations.
should probably be much better this way.
 

The Following 6 Users Say Thank You to impeham For This Useful Post:
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#83
Using both swaps on microSD card with backup swap on eMMC (for being able to boot, if microSD refuses to work) is very good. It should be quite easy, to implement it in ereswap - although, for 2 next weeks, I have very limited time for investigating it. Any input - like patches or even improved ereswap - highly appreciated. It would be great, to allow - tuneable by configuration - usage of any variant, no matter of partition layout (2 swaps, 3 swaps, eMMC, microSD...)

BTW, I agree that flip/flop on microSD only is slightly faster and saves eMMC from wear, but it doesn't affect SD card wear&tear - wear leveling is implemented on hardware level of microSD card, so it doesn't matter - for that case - if 1 or 1 partition is used on microSD (flip could be used all the time, with flop being idle, and wear would be exactly same as with flip and flop used one after another).

/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 2 Users Say Thank You to Estel For This Useful Post:
Posts: 2,292 | Thanked: 4,135 times | Joined on Apr 2010 @ UK
#84
Originally Posted by malkavian View Post
@sixwheeledbeast

This is not javascript, you can't simple equal a function to a variable.

Here you have your scripts corrected and improved I think. If you don't understand something of the code, just ask
I knew there was something wrong, although I am fairly new to writing scripts.
Saying that I got my version working too after seeing peter and vi_'s posts.

I have started a "talk wiki" page with my latest scripts (IMHO easier than taring them up)

In my version I had to move the position of swap0 in the logic part of the script as it was unnessacarily swapping from 0 to 1 then 2

The idea is to move the information to the Main page when complete.

@malkavian I don't understand the need for the RANDOM part of your script?

http://wiki.maemo.org/Talk:Swap_on_microSD
__________________

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-13 at 18:42. Reason: typo
 

The Following 2 Users Say Thank You to sixwheeledbeast For This Useful Post:
Posts: 78 | Thanked: 24 times | Joined on Feb 2012 @ Moscow
#85
Originally Posted by OMOIKANE View Post
I have N900 with swap on sd card partition. Swap on emmc is disabled.
And i have a problem with some osso applications. RSS, for example, after returning from microb, refreshing to main window, contacts refreshing to top of list after call. Both programs showing "<app name> - resuming" on the top. With emmc swap enabled glitch disappears. What to do?
Anyone? Tell me the truth)
 
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#86
Originally Posted by impeham View Post
I just increased the SD's swap size to 1.5GB instead of just 768MB in order to increase the time needed between reswap operations.
should probably be much better this way.
Yep, good idea. As filling up this much space takes longer until fragmentation starts, the need for swap refreshing will also take longer. And this minimizes the wear (each time you change swap location, all data -of currently used swap size- is moved).
Will increase my swap file also (as I fill it up once/twice a day during heavy usage).


Originally Posted by Estel View Post
Using both swaps on microSD card with backup swap on eMMC (for being able to boot, if microSD refuses to work) is very good.
Agree.

BTW, I agree that flip/flop on microSD only is slightly faster and saves eMMC from wear, but it doesn't affect SD card wear&tear - wear leveling is implemented on hardware level of microSD card, so it doesn't matter - for that case - if 1 or 1 partition is used on microSD (flip could be used all the time, with flop being idle, and wear would be exactly same as with flip and flop used one after another).
/Estel
Right.
But to minize wear to the maximum:
what about not disabling flip location, but enabling flop location with higher priority?
This will lead to flip still used (only read of old data) and all new swap on flop. Or/and vice versa. This way we do not have the need to move the currently used swap data.

Maybe I do not increase, but create second swap ....
 

The Following 4 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
#87
Originally Posted by OMOIKANE View Post
Originally Posted by OMOIKANE

I have N900 with swap on sd card partition. Swap on emmc is disabled.
And i have a problem with some osso applications. RSS, for example, after returning from microb, refreshing to main window, contacts refreshing to top of list after call. Both programs showing "<app name> - resuming" on the top. With emmc swap enabled glitch disappears. What to do?


Anyone? Tell me the truth)
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.
 
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#88
Originally Posted by peterleinchen View Post
But to minize wear to the maximum:
what about not disabling flip location, but enabling flop location with higher priority?
This will lead to flip still used (only read of old data) and all new swap on flop. Or/and vice versa. This way we do not have the need to move the currently used swap data.

Maybe I do not increase, but create second swap ....
But, without moving swap data and physically turning one down, it doesn't get un-fragmented, so when swap 2 also hit the limit, changing priority to higher for swap 1 won't help in fighting fragmentation...

So, it works only, until both swaps hit the limit. But, maybe after giving higher priority for swap 2, we could wait some time, and then quickly disable and re-enable (with still lower priority) swap 1, so it will be ready for taking higher priority again? Due to sitting with lower priority for some time, it should contain low amount of data for read, anyway.

/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 3 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
#89
Originally Posted by Estel View Post
But, without moving swap data and physically turning one down, it doesn't get un-fragmented, so when swap 2 also hit the limit, changing priority to higher for swap 1 won't help in fighting fragmentation...
Yes, you are right. Did not consider that we do need the dis-/enable game to defragment.
But ...

So, it works only, until both swaps hit the limit. But, maybe after giving higher priority for swap 2, we could wait some time, and then quickly disable and re-enable (with still lower priority) swap 1, so it will be ready for taking higher priority again? Due to sitting with lower priority for some time, it should contain low amount of data for read, anyway.
/Estel
... this could be good solution!
 
Posts: 461 | Thanked: 358 times | Joined on May 2010 @ Bilbao (Basque Country [Spain])
#90
Originally Posted by Estel View Post
Any input - like patches or even improved ereswap - highly appreciated. It would be great, to allow - tuneable by configuration - usage of any variant, no matter of partition layout (2 swaps, 3 swaps, eMMC, microSD...)
Ok, I suppose I will have time to try it

Originally Posted by Estel View Post
it doesn't affect SD card wear&tear - wear leveling is implemented on hardware level of microSD card, so it doesn't matter
All SD cards have wear leveling? Mine is a old 2Gb SD from my old Nokia N81.

Originally Posted by sixwheeledbeast View Post
@malkavian I don't understand the need for the RANDOM part of your script?
You (or we) wanted to share the damage to each swap partition on SD card so when it changes from backup swap to another, it doesn't use always the same partition, uses RANDOM to equally distribute the use. If, as said by Estel wear leveling is implemented, then it's not needed at all.

Originally Posted by sixwheeledbeast View Post
http://wiki.maemo.org/Talk:Swap_on_microSD
Great!

Originally Posted by Estel View Post
maybe after giving higher priority for swap 2, we could wait some time, and then quickly disable and re-enable (with still lower priority) swap 1, so it will be ready for taking higher priority again? Due to sitting with lower priority for some time, it should contain low amount of data for read, anyway.
Great solution... ops, more work to do XDDD. The time to wait might be big, to move the less possible data. We don't have "at" command in N900, so maybe a cron could be created and autoremoved, because an "sleep" command would be lose if you reboot the phone.
 

The Following 2 Users Say Thank You to malkavian For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 01:08.