How do I change swappiness? Running JACxHERO - G1 Q&A, Help & Troubleshooting

Title pretty much says it all.
In the rom's thread it says "NOTES:Swap is linux-swap by default. Edit the user.conf in /system/bin to change swappiness etc. Compcache modules built with the latest source are included if you want compcache or compcache with backing etc. Run sh /system/bin/swap -s to check swap status and other mod values." I entered sh /system/bin/swap -s in the terminal and it says that system and user is set to 30. What do I enter to change it?
Also, just curious.... When I run sh /system/bin/swap -s what should it say when it lists the CPU's powersave_bias?

Markley02 said:
Title pretty much says it all.
In the rom's thread it says "NOTES:Swap is linux-swap by default. Edit the user.conf in /system/bin to change swappiness etc. Compcache modules built with the latest source are included if you want compcache or compcache with backing etc. Run sh /system/bin/swap -s to check swap status and other mod values." I entered sh /system/bin/swap -s in the terminal and it says that system and user is set to 30. What do I enter to change it?
Also, just curious.... When I run sh /system/bin/swap -s what should it say when it lists the CPU's powersave_bias?
Click to expand...
Click to collapse
To change it. You would just pull that file change the 30 to whatever you want your swappiness to and then push it back. But honestly I would prolly just leave it at that.

Related

Problem with compcache

Im running a userinit file for the cyanogen 3.91 rom and if tried to run it with now success. it just shows 000 on the swap when i run free. and when i try to run cat /proc/ramzswap it says that no such directory exists,
this is the userinit.sh
#!/system/bin/sh
# $Id: userinit.sh,v 1.2 2009/07/17 01:11:25 noah Exp $
# Do not change the #! above and expect that shell to invoke this script at
# boot, because a2sd forcibly calls this with /system/bin/sh.
PATH=/system/xbin/bb:$PATH
# Currently our busybox build uses the "small" modprobe and insmod,
# which don't support parameter arguments. (The usage string lies.)
uname_r=`uname -r`
moddir=`find /system/modules -type d -name $uname_r`
insmod=/system/bin/insmod
if $insmod $moddir/compcache/xvmalloc.ko &&
$insmod $moddir/compcache/ramzswap.ko disksize_kb=32768
then
sysctl -w vm.swappiness=40
mknod /dev/ramzswap0 b 253 0
swapon /dev/ramzswap0
fi
exit;
# eof
yeah dude im getting the same problem. Ive asked everywhere and no one can help. the only difference i notice are the two lines (exit; # eof) at the end of yours.
EDIT:
DUDE, just got it to work, this is what to do:
go here: http://forum.xda-developers.com/showthread.php?t=537236
download the text file.
open the text file delete everything and paste this in:
Code:
#!/system/bin/sh
# $Id: userinit.sh,v 1.2 2009/07/17 01:11:25 noah Exp $
# Do not change the #! above and expect that shell to invoke this script at
# boot, because a2sd forcibly calls this with /system/bin/sh.
PATH=/system/xbin/bb:$PATH
# Currently our busybox build uses the "small" modprobe and insmod,
# which don't support parameter arguments. (The usage string lies.)
uname_r=`uname -r`
moddir=`find /system/modules -type d -name $uname_r`
insmod=/system/bin/insmod
if $insmod $moddir/compcache/xvmalloc.ko &&
$insmod $moddir/compcache/ramzswap.ko disksize_kb=32768
then
sysctl -w vm.swappiness=40
mknod /dev/ramzswap0 b 253 0
swapon /dev/ramzswap0
fi
save it and close it
rename it userinit.sh and type this in adb:
Code:
adb push userinit.sh /system/sd
adb shell chmod 755 /system/sd/userinit.sh (not sure if needed being safe)
adb shell reboot
hope that helps
did you get it to work on 3.91?
ive tried everything and still swap is 0 0 0 0
I'm not an expert in the whole compcache thing I haven't followed it but doesn't "free" in terminal show swap, not compcache? I believe "cat /proc/ramzswap" shows compcache compression..
alritewhadeva said:
I'm not an expert in the whole compcache thing I haven't followed it but doesn't "free" in terminal show swap, not compcache? I believe "cat /proc/ramzswap" shows compcache compression..
Click to expand...
Click to collapse
"free" shows the swap file total, used and free. ramzswap goes more indepth
ubernicholi said:
"free" shows the swap file total, used and free. ramzswap goes more indepth
Click to expand...
Click to collapse
ah ok. Thanks for the clarification.
i tried the cat /proc/ramzswap and it said the file or directory could not be found
Compache DOES NOT WORK ON 3.9.1

userint.sh help

im trying to run a script to turn swap on, but its not seeming to auto start at boot. am i missing something?
this is the script in my userinit.sh thats placed on the root of my sdcard
Code:
#!/system/bin/bash
su;
swapon /dev/block/mmcblk0p3;
sysctl -w vm.swappiness=30;
Exit 0;
i can turn swap on fine in terminal but this script isnt doing the trick.
ps i added the "su" command because in terminal it wouldnt let me turn swap on with out su, worth a try i thought

[Q] What about swap in the Milestone?

Hi guys,
I'm a milestone owner, and very happy with this device, I've upgraded it with 1,1ghz ULV module, memhack, busybox and JIT and it's a lighting, but here is a question that I have:
I'm a linux user so I started to "play" with the busybox addon of the terminal (straight on the device), I am also a maemo user where the swap file was usual to create on the sd to make the device more usable;
Now, how about the milestone? Using the swapper app in the market, it seems to not work (using "busybox free"in the terminal doesn't show me any swap) so how to enable a swap file or partition on the milestone? I think it will help a lot for the memory hungry systems, themes, and on developing roms linke the Dexter's froyo and sense mods (which lacks on the ram front)
Have anyone managed to have swap to work on the milestone? or Is out there any guide to do it?
This sounds like an excellent idea. As I am also a linux (Ubuntu 10.04) user too, having a swap "partition" on your Milestone will give "memory hungry" applications exactly what the need.
Will be watching this Thread!
Yeah, my question is about the fact that other phones (i heard about spica,dream,g1) have this feature, but the common command on linux/maemo does not work :/
Hope there is a solution :-(
So guys, the problem is in the kernel I frear...
using busybox, I've managed to create a small 128mb partition, and also a. Swap file (to test), but the function
"Swapon" says it's" not implemented" so where is the origin of the pWow thats strange that nobody tried ;-( ok I will try to find a solution and I will report back what I find. Hope to have skme help lol xD
Edit:
so" not implemented" is in the swapper2 application; doind it in the terminal these are the results:
export PATH=/data/local/bin:$PATH
$ su
# busybox swapon
BusyBox v6905964.73458437589.3945345.RELEASE_FROM_FUTURE (2010-04-10 21:43:08 MSD) multi-call binary.
Usage: swapon [-a] [-p PRI] [DEVICE]
Start swapping on DEVICE
Options:
-a Start swapping on all swap devices
-p PRI Set swap device priority
# busybox swapon -a
swapon: /etc/fstab: No such file or directory
# busybox swapon -a /sdcard
swapon: /etc/fstab: No such file or directory
# sudo gedit /etc/fstab
sudo: not found
# gedit /etc/fstab
gedit: not found
# vi /etc/fsteb
vi: not found
So thats it....what is this fstab file?? I know its about partition table or something like that, but why we lack it? We have to figure how to implement it...maybe in that way the swap can be set via busybox... help :-(
#roblem??? :-( help!
Looks like someone has figured it out!
Please someone try and report back
http://www.droidforums.net/forum/bl...built-source-fast-working-3dlauncher-220.html
kreat1ve said:
Looks like someone has figured it out!
Please someone try and report back
http://www.droidforums.net/forum/bl...built-source-fast-working-3dlauncher-220.html
Click to expand...
Click to collapse
nice find keat1ve ... perhaps i will try out in the evening. if my wife gets me some spare time ... the instructions at droidforums is not really correct for milestone. it has to be adapted a little bit!
Will try right now, I will tell you ^_^
Thx a lot!!
yes it can and has been done. swap adds working memory true, but all those writing/reading to/from a partition/file in your sdcard WILL slow down your phone and shorten your sd card's life. its your choice eventually: either you want more memory, or you want speed. you cant have both.
yantz
@kreat1ve
this guide about the partitioning with adb does not work with milestone, I will try to create a swap partition with partition magic and then use droid swapper to enable it... let's hope xD
I dont wonna sound negative or anything but this is for the droid which is completly open which probably has a customized kernel with swap enabled, while our milestone is locked and does not have swap enabled in its kernel . Anyway i dont think trying this will hurt so i hope it works out
Following the guide, does not gave me results, but I asked to he one that posted it for more info;
meanwhile I've managed to create a .swap file and mkswap it using busybox, these are the results:
export PATH=/data/local/bin:$PATH
$ $ su
# dd if=/dev/zero of=/sdcard/.swap bs=1024 count=262144
262144+0 records in
262144+0 records out
268435456 bytes transferred in 57.985 secs (4629394 bytes/sec)
# mkswap/sdcard/.swap
mkswap/sdcard/.swap: not found
# mkswap /sdcard/.swap
mkswap: not found
# swapon /sdcard/.swap
swapon: not found
# busybox mkswap /sdcard/.swap
Setting up swapspace version 1, size = 268431360 bytes
UUID=16e9c236-61d9-49ec-a023-c529adb3109c
# busybox swapon /sdcard/.swap
swapon: /sdcard/.swap: Function not implemented
# busybox swapon -a
swapon: can't stat '/dev/block/mmcblk0p3': No such file or directory
# busybox free
total used free shared buffers
Mem: 230500 227516 2984 0 32
Swap: 0 0 0
Total: 230500 227516 2984
#
so the problem is that swapon does not recognize the file (but manually puting fstab in /etc and a file 06userinit within /etc/init.d/ containing
Code:
#!/system/bin/sh
swapon -a) but probably a partition of the sdcard may be recognized....now the problem form me...
I use windows 7 64bit...how the hell can I partition my sdcard with a swap partition?? LOL! XD
This is what blocks me...lol
try here
or
here
kassy_ok said:
try here
or
here
Click to expand...
Click to collapse
sadly the problem is in the kernel...."not supported" is the result of every swapon command...have to wait an official support or a custom kernel in 2nd boot...let's hope and wait...
Question: can't it be solved by creating a module supporting swap-filesystem?
TheSSJ said:
Question: can't it be solved by creating a module supporting swap-filesystem?
Click to expand...
Click to collapse
I'm wondering if someone has created such module?
I don`t know~~
alncool said:
I'm wondering if someone has created such module?
Click to expand...
Click to collapse
It seems that creating such a module is very hard. See the page cyanogenmod for milestone here :
http://code.google.com/p/cyanogenmo...ID Type Status Priority Version Owner Summary
I suggest everyone to star the feature. Maybe it will be developped by someone ... who knows !
So my friends... anyone could avance on this thread?
Sounds promising... but i also get stuck when enabling the swapon...
Anyone?
Cya
Hi!
Now, when we have official Froyo for MM with 2.6.32.9 kernel, can anyone create SWAP module for this kernel?
kilabdg said:
Hi!
Now, when we have official Froyo for MM with 2.6.32.9 kernel, can anyone create SWAP module for this kernel?
Click to expand...
Click to collapse
unfortunately no. Swap is not a module in Linux kernel, it changes the kernel's internal behaviour, so you cannot compile as swap=m, it is definitely y or n.

[MOD](MIROSLAV_MM WE NEED YOU) Swap on data.

I found an interesting script for Galaxy I5500, which does allow users to create swap file in data/system partition. I tested it on I5500 because i own one right now and the script does indeed work, i also noticed improvement in the swap performance. Right now i'm trying to do this on GT540 but i found some difficulties and i need your help. If we'll make it working i will create script for GT540.
First of all, this is how it's done:
1. Open up your terminal.
2. Get superuser permission using su command.
3. Type this( make sure you have 64 mb of free memory on data partition ):
Code:
dd if=/dev/zero of=/data/swapfile1 bs=1024 count=65536
mkswap /data/swapfile1
swapon /data/swapfile1
It does work fine until swapon command usage which does give some retarded error "Invalid argument" Anyone have idea how to make this work?
You can delete swapfile1 using:
Code:
rm /data/swapfile1
This is not good idea, there is chance to broke nand.
Erm how much swap can we squeeze in there :/
I don't think it would do much difference, phone is accessing nand very often anyway when loading apps and system components which are stored there. I just want to try it out because it gives noticeable performance improvement on Galaxy I5500. I can test for bad blocks as well after some time of use.
@UP
It depends how much free memory do you have on your data partition, altough i don't advice to use swap bigger than 64 MB. Android won't use that much even with swappiness set to 100, so using large swap partition or file is just waste of memory. Not mentioning the fact that it will decrease performance.
bataya said:
This is not good idea, there is chance to broke nand.
Click to expand...
Click to collapse
Yeah, but probably in a few years, when you would probably use another, newer phone.
Do you have any idea what to do with this invalid argument error? If now i'll try to pm miroslav and ask him for help.
shadovraven said:
I don't think it would do much difference, phone is accessing nand very often anyway when loading apps and system components which are stored there. I just want to try it out because it gives noticeable performance improvement on Galaxy I5500. I can test for bad blocks as well after some time of use.
@UP
It depends how much free memory do you have on your data partition, altough i don't advice to use swap bigger than 64 MB. Android won't use that much even with swappiness set to 100, so using large swap partition or file is just waste of memory. Not mentioning the fact that it will decrease performance.
Click to expand...
Click to collapse
you can create many swap files/partitions at the same time. the OS will choose which swap to use depend on its priority. if 2 swap files/partitions have the same priority, it will be used in a round-robin fashion
by default many swap apps create only 32MB swap file because it's sufficient enough for the system. I've seen many people create a swap partition as large as 512MB-1GB. It won't give them any increase in speed because the system will only use a very small amount of them. My SD card have a 54MB swap partition and android use only about 8-16MB swap with swappiness set to 10. If I set it to 60 as default, the swap usage will be about 40-50MB
SWAP on Data (30mb)
Code:
#!/system/bin/sh
if [ -e /data/.swap.img ];
then
losetup /dev/block/loop7 /data/.swap.img;
mkswap /dev/block/loop7;
swapon /dev/block/loop7;
echo "swap on data"
else
dd if=/dev/zero of=/data/.swap.img bs=1024 count=30000;
losetup /dev/block/loop7 /data/.swap.img;
mkswap /dev/block/loop7;
swapon /dev/block/loop7;
echo "swap create & on data"
fi;
put file in init.d
miroslav_mm said:
SWAP on Data (30mb)
Code:
#!/system/bin/sh
if [ -e /data/.swap.img ];
then
losetup /dev/block/loop7 /data/.swap.img;
mkswap /dev/block/loop7;
swapon /dev/block/loop7;
echo "swap on data"
else
dd if=/dev/zero of=/data/.swap.img bs=1024 count=30000;
losetup /dev/block/loop7 /data/.swap.img;
mkswap /dev/block/loop7;
swapon /dev/block/loop7;
echo "swap create & on data"
fi;
put file in init.d
Click to expand...
Click to collapse
Thank you miroslav, gonna put this into start post.
EDIT: I tried that and it doesn't seem to work, i've put that into init.d but free command returns that swap size is 0. What permission i should set? I will try to do this manually.
EDIT2: I tried it manually, swapon /dev/block/loop7 returns invalid argument. I attached screenshot so you can see for yourself.
Bump for miroslav to see, I hope this will work.
/dev/block/loop7 for 2.6.29 for Android 2.1 for example
open RE
/proc/ open file partitions
find you Data part by side
look like mtdblock6 on SDSL 3.0
That is all.
I tried it on SDSL v3 and swapon /dev/block/mtdblock6; also does return invalid argument error.
Not recommended, it makes phone lag

[help]magsisk echo script on boot

I want to make an echo command with magisk on boot
echo 0 > /sys/class/leds/button-backlight/max_brightness
so that it is applied on boot automatically
how to do that ?
thanks in advance
Just put your script in
Code:
/magisc/.core/service.d
and set execution permissions.
Since you want to edit sys files, you will need root permission. An example script would be (brightness.sh) :
Code:
#!/system/bin/sh
su -c 'echo 0 > /sys/class/leds/button-backlight/max_brightness'
Note :
If you want to execute your script at another boot stage you should have a look at this
pec0ra said:
Just put your script in
Code:
/magisc/.core/service.d
and set execution permissions.
Since you want to edit sys files, you will need root permission. An example script would be (brightness.sh) :
Code:
#!/system/bin/sh
su -c 'echo 0 > /sys/class/leds/button-backlight/max_brightness'
Note :
If you want to execute your script at another boot stage you should have a look at this
Click to expand...
Click to collapse
Can you tell what the -c flag in your example script is for?
Yaseen_the_Gamer said:
Can you tell what the -c flag in your example script is for?
Click to expand...
Click to collapse
https://github.com/topjohnwu/Magisk/blob/master/docs/tools.md#su
It's to use su directly in the command, basically.
Although in this case it's technically unnecessary since all Magisk boot scripts are run with superuser access.

Categories

Resources