Notices


Reply
Thread Tools
Posts: 2,292 | Thanked: 4,135 times | Joined on Apr 2010 @ UK
#231
Originally Posted by chill View Post
I am still using 0.1.7 and am not seeing Swap to Device when I press Check status or Show Current, for example.
The issue was the huge warning dialog on Swap to Device was displayed every time you press that button. This wasn't the intention and I'd find this annoying, you only need warning once.
Flopswap 0.1.8 update fixes this.
__________________

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 2 Users Say Thank You to sixwheeledbeast For This Useful Post:
Posts: 262 | Thanked: 315 times | Joined on Jun 2010
#232
Is it possible to use 'expr' or 'bc' for calculations given busybox's limitations?
 
Posts: 2,292 | Thanked: 4,135 times | Joined on Apr 2010 @ UK
#233
Originally Posted by Xagoln View Post
Is it possible to use 'expr' or 'bc' for calculations given busybox's limitations?
I believe expr still suffers from int32 and bc is not in maemo busybox.
There are no alternatives that with run without installing other packages. bash or busybox-power would fix this but I don't want to force people to use these, hence the warning dialog etc.
__________________

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:
Posts: 252 | Thanked: 221 times | Joined on Jul 2010
#234
I'm still looking into int32 and your code.

Is ugbytes actually used as input to any calculation or banner?

Also, is /tmp/flopswapint ever written to?

Thanks.

EDIT: I see /tmp/flopswapint (it's existence, not content) is used as a flag to indicate Flopswap can no longer calculate the percentage used, and once set it stays up (until reboot). To set the flag you create the file.
__________________
21.2011.38-1Smaemo7 (CSSU Stable)
2.6.28.10power53 (not overclocked)
Yes, I search before posting.

Last edited by chill; 2014-05-08 at 00:48.
 
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#235
Just do NOT use bytes!

I told you once upon a times, divide output by 1000 (should suffice) and use KiBytes for calculation.
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature

Last edited by peterleinchen; 2014-05-08 at 06:12. Reason: kiBi kB whatever ...
 
Posts: 252 | Thanked: 221 times | Joined on Jul 2010
#236
Ok here's my 2 cents, and please correct me where I'm wrong. In swapused.sh you convert the used blocks (reported by /proc/diskstats) directly to MB, and then compare to the swap size reported by /proc/swaps. The latter you also convert to MB from the KB reported. There is no multiplication here, so we are not likely to hit an int32 overrun. We cannot divide much further, e.g. to get GB, because swap sizes are usually under a GB, and integer/integer division, which is truncated, would give swap size 0. The only small issue here is that you are getting ugbytes by dividing ublocks with 1024, which is incorrect; however, I don't see that ugbytes are really used anywhere, except to print out in the terminal.

Now, in swapswitch.sh:

Code:
#Get blocks used since boot from /proc/diskstats
ublocks=$(awk '{if ($3=="'"$disk"'") print $10}' /proc/diskstats)
echo $ublocks ublocks
#Multiply blocks by 512 to get used bytes
ubytes=$(($ublocks*512))
ubytes is then used to get umbytes and ugbytes. Now, multiplying ublocks with 512 will cause an int32 overrun earlier than necessary, here is why. Normally int32 will hit at 32 bits of 512-byte blocks, i.e. 2 TB. If you multiply ublocks with 512, it will hit at 2 TB/512 = 4 GB. This is a reasonably achievable amount of written swap, and may explain why I encountered int32 overrun after about 17 days of runtime. Why not get umbytes (and ugbytes if needed anywhere) directly by dividing by 2048, as in swapused.sh?
__________________
21.2011.38-1Smaemo7 (CSSU Stable)
2.6.28.10power53 (not overclocked)
Yes, I search before posting.
 

The Following 2 Users Say Thank You to chill For This Useful Post:
Posts: 638 | Thanked: 1,692 times | Joined on Aug 2009
#237
Since i have installed flopswap to use a fast Samsung 64GB sdxc card with swap partitions, i'm experiencing issues with hildon-status-menu starting before the optified mount point become available.

This happens because the N900 seems to start and run so fast that the boot order seems a little different!

If someone else is experiencing problems with python plugins of hildon-status-menu, here the trick

Modify: /etc/X11/Xsession.post/15hildon-status-menu
To:

#!/bin/sh
sleep 5 && /usr/sbin/dsmetool -t /usr/bin/hildon-status-menu

Last edited by xes; 2014-05-10 at 20:48.
 

The Following 3 Users Say Thank You to xes For This Useful Post:
Posts: 2,292 | Thanked: 4,135 times | Joined on Apr 2010 @ UK
#238
Originally Posted by chill View Post
Is ugbytes actually used as input to any calculation or banner?
No, it's left over from a previous version.

Originally Posted by chill View Post
I see /tmp/flopswapint (it's existence, not content) is used as a flag to indicate Flopswap can no longer calculate the percentage used, and once set it stays up (until reboot). To set the flag you create the file.
Correct.

Originally Posted by chill View Post
Ok here's my 2 cents, and please correct me where I'm wrong.

Now, in swapswitch.sh:
Why not get umbytes (and ugbytes if needed anywhere) directly by dividing by 2048, as in swapused.sh?
Thank you for being so verbose with your explanation, I would have not seen this error.
Basically I have applied peter's int32 fix to one file (this is the part surrounded by comment marks) I have forgotten to do the same in the other.

Originally Posted by chill View Post
This is a reasonably achievable amount of written swap, and may explain why I encountered int32 overrun after about 17 days of runtime.
TBH I saw the whole int32 and only 17 days of runtime a non-issue anyway.
At the end of the day you will hit int32 at some point. This is why I have recommended that you use the check swap to calculate your swap usage. Then setup something to automatically run swapswitch.sh at night.
I see the int32 banner as a band-aid really.
Now that I see more people wishing for longer calculation runtimes I will look into a overall better solution.
For now I have quickly fixed and tidied up the bits pointed out above.
Flopswap 0.1.9 is uploaded to Extras-Devel.


Originally Posted by xes View Post
Since i have installed flopswap to use a fast Samsung 64GB sdxc card with swap partitions, i'm experiencing issues with hildon-status-menu starting before the optified mount point become available.

This happens because the N900 seems to start and run so fast that the boot order seems a little different!

If someone else is experiencing problems with python plugins of hildon-status-menu, here the trick

Modify: /etc/X11/Xsession.post/15hildon-status-menu
To:

#!/bin/sh
sleep 5 && /usr/sbin/dsmetool -t /usr/bin/hildon-status-menu
This is interesting, while it doesn't seem to be flopswap at fault I think we need to find a reason and a better solution (maybe in another thread?). This obviously shouldn't happen, I also have never experienced this. The boot process shouldn't allow h-s-m to start without the points it needs being ready.
__________________

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 4 Users Say Thank You to sixwheeledbeast For This Useful Post:
Posts: 252 | Thanked: 221 times | Joined on Jul 2010
#239
TBH I saw the whole int32 and only 17 days of runtime a non-issue anyway.
At the end of the day you will hit int32 at some point.
Of course, but for practical purposes it matters when IMO. With the previous script, 2TB/512=4GB ~ 17 days, and with the new script 2TB*2048 [because you are dividing by 2048] = 2TB/512 * (512*2048) ~ 17*512*2048 days (let's use my runtime to estimate here). That's a lot of days, especially considering that our N900 will get rebooted, willingly or not, many times before that time.

Note this is assuming /proc/diskstats can report more that 32 bits of swap written, and that busybox can read and then divide it (by 2048). The latter is probably not true - if busybox can't store the result of a division if it has >32 bits, then it probably can't read an operand that's >32 bits, either. In that case we will hit int32 when /proc/diskstats reports swap written >32 bits, which is 32 bits of 512 bytes = 2 TB. This is still 2TB/512 * 512 ~ 17 days * 512 = 23 years. Assume instead I write 4 GB of swap every day instead of every 17 days, and I still get a year and a half of swap-worry-free uptime.

This is why I have recommended that you use the check swap to calculate your swap usage. Then setup something to automatically run swapswitch.sh at night.
Hmm, I'm not sure how running swapswitch.sh mitigates the problem. The amount of swap written since boot (/proc/diskstats) can only increase, and swapswitch.sh does not decrease it. Can you clarify?

Thanks again for your effort.
__________________
21.2011.38-1Smaemo7 (CSSU Stable)
2.6.28.10power53 (not overclocked)
Yes, I search before posting.
 

The Following 2 Users Say Thank You to chill For This Useful Post:
Posts: 2,292 | Thanked: 4,135 times | Joined on Apr 2010 @ UK
#240
Originally Posted by chill View Post
Of course, but for practical purposes it matters when IMO. This is still 2TB/512 * 512 ~ 17 days * 512 = 23 years. Assume instead I write 4 GB of swap every day instead of every 17 days, and I still get a year and a half of swap-worry-free uptime.
Yep I agree.
I still feel the fact you could reach int32 is a problem.
My next task is to find out if /proc/diskstats can report more that 32 bits of swap written. Has anybody tested this? If this is not possible then I cant see how it could be fixed.

Originally Posted by chill View Post
Hmm, I'm not sure how running swapswitch.sh mitigates the problem. The amount of swap written since boot (/proc/diskstats) can only increase, and swapswitch.sh does not decrease it. Can you clarify?

Thanks again for your effort.
You use the "Check Status" to work out how quickly you use your swap allocation in days. Then use this to setup a cron job at a convenient time to run swapswitch.sh. This was the original concept for flopswap.
You should have calculated your swap usage within the period of swap it took to reach int32. However it seems people wish to use flopswap, differently so I have/will continuously adapt it if possible.
__________________

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; 2014-05-13 at 11:27. Reason: typo
 

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


 
Forum Jump


All times are GMT. The time now is 04:43.