|
2011-05-02
, 19:30
|
Posts: 1,258 |
Thanked: 672 times |
Joined on Mar 2009
|
#162
|
The Following 3 Users Say Thank You to shadowjk For This Useful Post: | ||
|
2011-05-18
, 12:04
|
Posts: 284 |
Thanked: 320 times |
Joined on May 2010
@ Peterborough, UK
|
#163
|
I have a script which looks at the output of 'iostat -m' command. When the amount of megabytes written to a swap partition exceeds the size of the swap partition, the fragmentation effects start. I store the megabytes written in a file after reswap(swapon temp, swapoff main, swapon main, swapoff temp) and keep track of bytes written after last reswap.
|
2011-05-18
, 12:35
|
Posts: 1,680 |
Thanked: 3,685 times |
Joined on Jan 2011
|
#164
|
#!/bin/sh #swapswap current_swap=$( cat /proc/swaps | awk '/mmcblk/ {print $1}' | cut -d "k" -f2 ut -c1) drivelist=$(sfdisk -lnd /dev/mmcblk1) swapmicro=$(echo "$drivelist" -n | grep Id=82 | awk '/mmcblk1/ {print $1}') if [ "$current_swap" = "0" ]; then if [ "$swapmicro" ]; then swapon $swapmicro swapoff /dev/mmcblk0p3 fi #echo "swap is on sd" elif [ "$current_swap" = "1" ]; then swapon /dev/mmcblk0p3 swapoff $swapmicro #echo "swap is on emmc" fi
#!/bin/sh #check if device is not in use, if so swapswap! brightness=$(cat /sys/class/backlight/acx565akm/brightness) keyboard=$(cat /sys/devices/platform/gpio-switch/slide/state) if [ "$brightness" == "0" ]; then if [ "$keyboard" == "closed" ]; then echo "/opt/scripts/swapswap.sh" | root echo "/opt/scripts/swapswap.sh" | root fi fi
The Following 7 Users Say Thank You to vi_ For This Useful Post: | ||
|
2011-05-19
, 13:12
|
Posts: 1,258 |
Thanked: 672 times |
Joined on Mar 2009
|
#165
|
Hey, is this the script you speak of? I'm a bit confused as to why it's looking at mmcblk0p2, and also the swap bits at the end are giving me a headache trying to figure out
|
2011-05-19
, 15:39
|
Posts: 284 |
Thanked: 320 times |
Joined on May 2010
@ Peterborough, UK
|
#166
|
|
2011-05-19
, 20:49
|
Posts: 1,258 |
Thanked: 672 times |
Joined on Mar 2009
|
#167
|
The Following 4 Users Say Thank You to shadowjk For This Useful Post: | ||
|
2011-05-19
, 21:19
|
Posts: 1,680 |
Thanked: 3,685 times |
Joined on Jan 2011
|
#168
|
I hope you're using charge21.sh which is newest right now...
I always run it out of /root, so iconsistencies in relative vs absolute paths never hit me
Additionally I have a script that I run on every boot, which among other things set reswap.stat to 0.
mmcblk0p3 is normal emmc swap. mmcblk1p3 in iostat.
mmcblk1p2 is microsd swap, mmcblk0p2 in iostat.
I leave emmc swap on, it sits at lower priority anyway, so I only have to do a swapoff if I want to remove back cover. No other particular reason. At one point I probably had a swapon binary with priority support and had emmc+usd at equal priority, but then I concluded performance was nicer when swap was dedicated to usd.
The general idea is indeed: swapon emmc, swapoff usd, swapon usd, swapoff emmc, swapon emmc.
|
2011-05-20
, 01:39
|
Posts: 1,258 |
Thanked: 672 times |
Joined on Mar 2009
|
#169
|
|
2011-05-20
, 09:00
|
Posts: 284 |
Thanked: 320 times |
Joined on May 2010
@ Peterborough, UK
|
#170
|
The Following User Says Thank You to Tigerite For This Useful Post: | ||
I would really like to read our specialist explanation on this though, cause it is highly possible that i missed something.