yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] pinetreehater:
I've been running the phone with the up_threshold at 16....realizing I would have significant drain on my battery.

However, I have noticed very little drain. In fact, the phone feels a little quicker overall and it still makes it through the day with moderate use.

Any downside to running the cpu threshold so low (outside of battery)?
[G1 Android Development] miketaylor00:
Your phone is going to very quickly jump from one CPU frequency to the next. It doesn't take much to get your CPU up to 16% utilization. There is a little bit of lag when that happens. But you will get up to your max CPU pretty quickly that way. Once you are at your Max it won't matter because it can't go any higher. However, it will also drop really fast too. So if you use your phone continuously you won't notice much but if you use it for a few seconds at a time with breaks in between you will probably notice some lag when you are first starting to use it. I tried dropping my threshold really low and I didn't like it. I often pop on my phone to check things and it was really laggy for that first little bit. I've done quite a bit of tweaking on mine and I think I have found a pretty good configuration.
[G1 Android Development] pinetreehater:
Oh, and I forgot to mention....I ditched compcache . The phone is much quicker with just a linux swap....i am sure of it.
[G1 Android Development] cal3thousand:
Care to share the recipe to your secret sauce?
[G1 Android Development] miketaylor00:
I don't mind sharing it but I am not sure it will work well on other ROMs. I have been working on xROM which runs much better on Compcache than Linux Swapping. So if you normally use Swap instead of Compcache I would suggest that you stick with that. I have seen good improvement on xROM with these settings. I also compared it with Benchmark Pi and had about a 2 second improvement on average. Here's the file. I hope it works for you. If not, sorry.

Edit: I also heard that Cyanogen works better with powersave_bias set to 200. It doesn't on xROM. So again, I'm not sure this will help on other ROMs but your free to try it. If you use Cyan you might keep this setting along with Linux Swap. Try it both ways. It's easy to change the settings.
[G1 Android Development] Rmag37:
/\

|

Is that the same one you posted in jacxrom?

If so than I can vouch for the speed, it runs really smooth, and I've started manually overclocking up to 527mhz when I plan on being on my phone for a long time or doing something system intensive, like tethering music and games at once.
[G1 Android Development] miketaylor00:
It's the same one. I just don't know how it will work on other ROMs. I know it is good on xROM but I've heard Cyan reacts differently to some of the settings. It's worth a try if someone wants to do it.
[G1 Android Development] miketaylor00:
It doesn't matter what I set my Compcache disk size to in my user.conf. It is always 32MB. Is this supposed to be this way? Has anyone else seen this? I tried setting it to 28MB and it ignores the setting. Any ideas?
[G1 Android Development] Rmag37:
To use compcache with backing_swap

-set compcache=1

-set cc_backingswap_en=1

-set linux_swap_en=0

-set cc_disksize=0

-set cc_memlimit=8

That's from the main post, maybe you aren't allowed to change that with backingswap?
[G1 Android Development] miketaylor00:
I didn't see that. Maybe that is right, it might need 32MB for back swapping. Can anyone confirm this?
[G1 Android Development] huanyu:
If you are using CompCache with backingswap, the disksize you found on the log is refer to the actual swap partition size. The cc_disksize is ignored when backingswap is used. If you wanna to change the ramzswap size use in CompCache with backingswap, you can change cc_memlimit.
[G1 Android Development] miketaylor00:
Thanks for the info.
[G1 Android Development] ElChouch:
THen here's what I get when launching sh /system/sd/userinit.sh

C:\android-sdk-windows-1.5_r1\tools>adb shell sh /system/sd/userinit.sh

/compcache/xvmalloc.ko not found

/system/sd/compcache/xvmalloc.ko not found
[G1 Android Development] huanyu:
Which rom are you using?

The script was not able to find your kernel module directory for compcache
[G1 Android Development] cal3thousand:
Thank you much. I will download and take a look. Will report back my findings if I use it.
[G1 Android Development] uwonsum:
It seems your install is borked some how. re-install the ROM.
[G1 Android Development] miketaylor00:
Thanks man, I've been dying to know how this will work on a Cyan ROM but I haven't had time to switch over.
[G1 Android Development] miketaylor00:
Do me a favor. Try running it just as it is. If it doesn't improve performance and you usually use linux-swap, try changing just that and see how it does.
[G1 Android Development] traspler:
Do I have to manually create a swap partition or is it enough to just enable backing swap and then run the script?

Can I use "sys_vm_en=1" without setting backing swap or linux swap?

In the first post there is the following suggestion:

Why is the cc_disksize set to 0?
[G1 Android Development] miketaylor00:
You do not need a separate Linux-Swap partition to run backing swap. You can also use sys_vm_en without a linux-swap partition.

The cc_disksize is set to 0 because the default is 32MB and you can't change it. It doesn't hurt to put 32 in there.
[G1 Android Development] traspler:
Thank you for the fast answer :)

Another thing: When I update my CM ROM (through CM Updater) will the script and user.conf get deleted? If not, do I have to run the script again?
[G1 Android Development] miketaylor00:
Most likely it will overwrite the file with the default for the build. I don't know if cyanogen built in logic to keep it during an upgrade or not. I would plan on running it again.
[G1 Android Development] senaia:
hate to be a real n00b and a pain, but could anybody do me a favour please, i need a userinit for CM 3.9.8, compcache, only 2 partitions (fat32 + ext3) and media on ext. this all looks rather confusing to me to set up, i had compcache enabled before the kernal was changed and compcache was upgraded, but for that i just used the userinit that was posted in the thread at the time. use whatever settings work best for you, but remember i don't have swap partition.

many thanks in advance, and sorry for being a n00b and not doing it myself :(
[G1 Android Development] miketaylor00:
If you used my file you don't need a linux swap partition. You can use compcache with back swapping with your setup. If you weren't talking about mine give it a try and let me know how it works.
[G1 Android Development] senaia:
thanks, phone took a grand total of 32 seconds to boot, only thing i changed was powersave bias back to 200

=== user.conf ===
*** general ***
apps2sd=0
media2sd=1

*** CompCache ***
compcache_en=1
cc_memlimit=18
cc_disksize=32
cc_backingswap_en=1
cc_backingswap=/dev/block/mmcblk0p3
swappiness=30

*** Linux Swap ***
linux_swap_en=0
linux_swap_partition=/dev/block/mmcblk0p3

*** VM ***
sys_vm_en=1
page_cluster=3
laptop_mode=0
dirty_expire_centisecs=3000
dirty_writeback_centisecs=500
dirty_background_ratio=5
dirty_ratio=10

*** CPU ***
proc_cpu_en=1
scaling_min_freq=192000
scaling_max_freq=528000
sampling_rate=2000000
powersave_bias=200
up_threshold=45

=== CompCache status ===
CompCache version 0.6+
Compcache enabled
CompCache: MemLimit (system) 18432(user)
CompCache: BackingSwap (system) /dev/block/mmcblk0p3(user)
CompCache: cc_swappiness - 28(system) 28(user)

=== CompCache status output ===
DiskSize: 32768 kB
NumReads: 304
NumWrites: 927
FailedReads: 0
FailedWrites: 0
InvalidIO: 0
NotifyFree: 17
PagesDiscard: 0
ZeroPages: 60
GoodCompress: 69 %
NoCompress: 3 %
PagesStored: 850
PagesUsed: 309
OrigDataSize: 3400 kB
ComprDataSize: 1170 kB
MemUsedTotal: 1236 kB

=== VM status ===
Set VM: page-cluster - 3(system) 3(user)
Set VM: laptop_mode - 0(system) 0(user)
Set VM: dirty_expire_centisecs - 3000(system) 3000(user)
Set VM: dirty_writeback_centisecs - 500(system) 500(user)
Set VM: dirty_background_ratio - 5(system) 5(user)
Set VM: dirty_ratio - 10(system) 10(user)

=== CPU status ===
Set CPU: scaling_min_freq - 192000(system) 192000(user)
Set CPU: scaling_max_freq - 528000(system) 528000(user)
Set CPU: sampling_rate - 2000000(system) 2000000(user)
Set CPU: powersave_bias - 200(system) 200(user)
Set CPU: up_threshold - 45(system) 45(user)
[G1 Android Development] miketaylor00:
Awesome. Thanks for the info. I knew powersave bias helped on cyanogen but it hurts xROM. I will update this and send it to cyanogen to see if he wants to include it in his build.
[G1 Android Development] huanyu:
From my understanding, you do need either swap partition or a swap file to work for compcache backingswap. For compcache v0.5, the backingswap only works with swap partition while v0.6 works with both swap partition and file. Backing swap with swap file is not currently implemented in this version of script yet. It will be included in next release.
[G1 Android Development] huanyu:
The output indicates the backingswap is not enabled, and the compcache initialize a 32MB of ramzswap (base on your cc_disksize).

The script checks the existence of the backingswap partition, if it failed, it uses ramzswap instead. Looks like the swap partition is missing here.
[G1 Android Development] senaia:
i don't have swap partition, so it's not enabled :)
[G1 Android Development] huanyu:
^^ so you are aware that you are actually running a compcache with 32MB (cc_disksize) ramzswap.
[G1 Android Development] miketaylor00:
I posted this before reading the rest of the thread. See my next post.
[G1 Android Development] miketaylor00:
Ok. I didn't know that. Someone told me it was working on xROM which has compcache v0.6. I don't know if it was modified to work with file swap. Thanks for the information.
[G1 Android Development] SladeOfDArk:
sup guys.. i just pushed the files and rebooted .. ive read around so forgive me if i ask

WHAT EXACLTY IS COMPCACHE and what iwll it do for me? how do i know what the best configuration will be? my unit runs fast and smooth and ive not had a single hicup since i got the phone a few days ago and have been modding nonstop im running:

Rooted ofcourse

Cyan Latest

cyan recovery 1.4

latest radio 2.2. something blah blah

i have a n 8gig class 4 PNY SD card partitioned as such:

6gig Fatty, 500MBext2,32mb Linux Swap

what config should i use for my compcache?

thanks in advance
[G1 Android Development] miketaylor00:
Everything you need to know about compcache http://code.google.com/p/compcache/

The settings I posted in my user.conf earlier in the thread will work fine. Compcache 0.6 is much faster than 0.5 but you can still run it on the version you have.
[G1 Android Development] SladeOfDArk:
okay ill go read up thank you.. i have compcache version 0.6++

ill go and find your post.. can i do those commands from ADB ? or must i use terminal on the phone?
[G1 Android Development] miketaylor00:
You should be able to use adb
[G1 Android Development] simms22:
ah , nice . you have it up and running :)
[G1 Android Development] drpfenderson:
Once you put the files in the right place, from adb you can run

adb shell /system/sd/userinit.sh -s

to get output on whether it is working properly or not...
[G1 Android Development] SladeOfDArk:
what should i look for to tell me if its working or not?

C:\Android>adb shell

# sh /system/sd/userinit.sh -s

sh /system/sd/userinit.sh -s

=== user.conf ===

*** general ***

apps2sd=0

media2sd=1

*** CompCache ***

compcache_en=1

cc_memlimit=16

cc_disksize=32

cc_backingswap_en=0

cc_backingswap=/dev/block/mmcblk0p3

swappiness=30

*** Linux Swap ***

linux_swap_en=0

linux_swap_partition=/dev/block/mmcblk0p3

*** VM ***

sys_vm_en=0

page_cluster=0

laptop_mode=0

dirty_expire_centisecs=3000

dirty_writeback_centisecs=500

dirty_background_ratio=5

dirty_ratio=10

*** CPU ***

proc_cpu_en=0

scaling_min_freq=128000

scaling_max_freq=528000

sampling_rate=2000000

powersave_bias=200

up_threshold=32

=== CompCache status ===

CompCache version 0.6+

Compcache enabled

CompCache: DiskSize 32768(system) 32768(user)

CompCache: cc_swappiness - 30(system) 30(user)

=== CompCache status output ===

DiskSize: 32768 kB

NumReads: 118

NumWrites: 838

FailedReads: 0

FailedWrites: 0

InvalidIO: 0

PagesDiscard: 0

ZeroPages: 59

GoodCompress: 65 %

NoCompress: 4 %

PagesStored: 779

PagesUsed: 314

OrigDataSize: 3116 kB

ComprDataSize: 1121 kB

MemUsedTotal: 1256 kB

That is what i got, it doesnt look like backing swap is on OR Linux Swap i would like to try the backingswap.. to see how it runs.
[G1 Android Development] huanyu:
Yap.. it working. 32MB of ramzswap.

The neither linux swap or backing swap is not enabled.

if the third partition of your SD card is swap partition, all you need to do is change the user.conf setting

cc_backingswap_en=0

to

cc_backingswap_en=1
[G1 Android Development] SladeOfDArk:
okay thanks. But when i type that command in ADB its not STICKING that is my problem.. Also how much will enabling that backing swap help. is the BACKINGSWAP the alternative to the linux swap? ive tried typing that command a bunch of times and rebooting but when i view the current setting its back to 0 instead of 1. and yes the third partition of my SD card is a 32mb linux swap
[G1 Android Development] huanyu:
Yes, backingswap is the alternative to linux swap but manage by compcache. So the uncompressed page can store in backingswap rather than ramswap. In another word, the ramswap is more utilized

This is hard to say how much will the backingswap help.

sorry you need to modify the user.conf file
[G1 Android Development] miketaylor00:
It looks like compcache is working. Backing swap will only work with a linux-swap partition if you are on Compcache 0.5. Also, the OP said that this script doesn't support using backswap on the ext partition. So you might have to wait until this script gets updated or setup a third partition which will wipe your data on your ext partition.
[G1 Android Development] SladeOfDArk:
okay i see.. so let me ask this: is there any point to using compcache if backing swap is not enabled?
[G1 Android Development] miketaylor00:
Yes, Compcache does pretty well on it's own. v0.6 is faster than 0.5 but they both work. Backing swap seems to help a little but isn't required. Everyone who has used my user.conf has seen an improvement in performance - so far. And at least one person was running it without having backing swap turned on.
[G1 Android Development] ThR1LL:
Sorry I'm a little confused by this. So backing swap will or will not work when I have a linux-swap partition on Compcache 0.6?
[G1 Android Development] SladeOfDArk:
okay thank you again for answering single post questions i really did read thoroughly just missed the part about .06 compatibility.. well i think i found your config file so im going to push it now and see how things feel. now all i should have to do is PUSH the file right? or will i need to go into adb shell and run the command sh /system/sd/userinit.sh -c after i push the file?

thanks

Edit: wait a second it is an already configured userinit file.. so i wont need to do the sh/system/sd/blahblah. .thing. sorry dumb question

edit:

# sh /system/sd/userinit.sh -s

sh /system/sd/userinit.sh -s

PK♥┼ó: not found

┼ó: not found

/system/sd/userinit.sh: 4: Syntax error: ";" unexpected
[G1 Android Development] miketaylor00:
It will work if you have a linux-swap partition.
[G1 Android Development] miketaylor00:
Copy the user.conf that I posted to /system/bin/user.conf. then reboot. Check your settings after reboot and it should be good.
[G1 Android Development] huanyu:
both version of compcache work with a linux-swap partition. only version 0.6+ works with swap file.

Looks like you edit the user.conf file with notepad.

if you are use notepad++ to convert the file to unix format (Format menu tab -> Convert to Unix format)
[G1 Android Development] Phlogiston:
Is this supposed to work on latest cyanogen 3.9.9.1?
[G1 Android Development] SladeOfDArk:
AWESOME THAT WORKED! I had not touched the file with notepad but what i DID do was try and use mikeytaylor00 file and it must have got messed up then.. i went back to the original file and opened it with Notepad++ and edited them that way. WAY more comfortable than doing the whole command line deal.. now i have THIS.

=== CompCache status output ===

BackingSwap: /dev/block/mmcblk0p3

DiskSize: 31250 kB

MemLimit: 16384 kB

NumReads: 87

NumWrites: 756

FailedReads: 0

FailedWrites: 0

InvalidIO: 0

NotifyFree: 4

PagesDiscard: 0

ZeroPages: 52

GoodCompress: 100 %

NoCompress: 0 %

PagesStored: 439

PagesUsed: 91

OrigDataSize: 1756 kB

ComprDataSize: 346 kB

MemUsedTotal: 364 kB

BDevNumReads: 9

BDevNumWrites: 261

Beautiful , and now im ready to make myself a signature then learn how to make my own themes (im good with graphics). Everything i can do has been done to the phone software wise..next is extended battery and install a new speaker on the phone!
[G1 Android Development] uwonsum:
Yes on 3.9.x
[G1 Android Development] tman7510:
'User.conf Settings" what do they mean?

Can anybody explain what these settings actually do? I understand the cpu frequency and up threshold but what does power-bias of 200 mean. What about dirty writebacks, dirty ratio,dirty background, It would be nice if someone would point me to some documentaion that explains these values to me. I checked out the google code project page for compcache but nothing specific about the settings? Any help would be apreciated
[G1 Android Development] Phlogiston:
Ok I just notices that compcache makes my phone unusable slow...
[G1 Android Development] uwonsum:
If you have cyanogen's ROM, you know by default he now enables compcache. I doubt compcache is the reason your phone is slow. You will need to provide more details.

Also, I have tested the latest userinit script, great work again huanyu. It works with fine with the lastest Cyanogen's ROM.
[G1 Android Development] sacredsoul:
I tried compcache + backingswap with swap file... This is the output.

Isnt good compress supposed to be at 100% or am I mistaken?
[G1 Android Development] huanyu:
can you run adb shell /system/sd/userinit.sh again for me

somehow the backingswap with swap file is not working properly.
[G1 Android Development] prash:
It this info correct in the original post?

To use compcache with linux swap file

-set swap_file_en=1

-set linux_swap_file_size=32

-set linux_swap_file=/system/sd/swap.file

-set compcache=1

-set cc_backingswap_en=0

-set cc_disksize=32

-set linux_swap_en=1

-set linux_swap_partition=/system/sd/swap.file (shouldn't this point to the /dev/block/mmcblk0p3 partition?)
[G1 Android Development] huanyu:
yes this is correct if you wanna to use swap file instead of swap partition
[G1 Android Development] sacredsoul:
This is what I get
[G1 Android Development] prash:
Ok, it makes sense, I was just confused since it was setting a partition location to a file..but I suppose that's what it was supposed to do. My mistake carry on! Thanks for the awesome script!
[G1 Android Development] huanyu:
actually i found your problem, you forgot to set cc_backswap_en=1
[G1 Android Development] Phlogiston:
Thanks for the update.

PS: When chaging options you can just call the script instead of rebooting:

adb shell sh /system/sd/userinit.sh
[G1 Android Development] Phlogiston:
small typo in script: Createing swap file:
[G1 Android Development] sacredsoul:
Its backingswap right? This are my settings.

Will update you soon. Thanks for the hard work!

This is what I get...

Doesnt look good....
[G1 Android Development] uwonsum:
Deleted. Solution above.
[G1 Android Development] huanyu:
the status output looks correct. The output of adb shell /system/sd/userinit.sh does not look normal
[G1 Android Development] sic08869:
Very nice, thank you for the effort =)
[G1 Android Development] sacredsoul:
Any idea why? :o
[G1 Android Development] Janis:
Cyanogen 3.9.10 tested and OK

I tested this with Cyanogen's 3.9.10. It seems to work well.

Here's my post in that thread.

Swappiness set to 60. CPU idle set to 245.... Linux swap and compcache enabled.

I enable compcache because it caches web pages in the browser. they don't have to reload then, which takes longer, much longer, than pulling them from the cache. It may make the phone a wee bit slower, but not so that I can tell. It does make the phone faster if no other swapping is enabled. I've got my phone so overloaded, any kind of swapping enabled actually relieves me of constant force close/waits.
[G1 Android Development] warburto:
Using the user.conf file posted in this thread. Thanks Mike.

http://xdaforums.com/showthread.php?p=4334135&highlight=user.conf#post4334135

Because the new cyanogen 3.9.10 has no userinit.sh file I am unsure of how to test whether compcache is active or not. Anyone know? Also, if I disable compcache and enable the linux-swap, what would the command to test whether that was active be?
[G1 Android Development] miketaylor00:
You're welcome. I tried using linux swap and it was much slower. I was just trying to get the fastes settings. I had no bias toward using compcache.

Here is the command that will allow you to see what is running

su

sh /system/sd/userinit.sh -s

Another guy using my config tried it and this sh does work for cyan builds.
[G1 Android Development] xcallibur:
I can confirm that it does work on the latest Cyan build.

I prefer not to use Compcache, for some reason I get better long term performance with just swap enabled so I tewaked my user.conf for that and dropped the cpu up threshold to 40% with the minimum frequency at 245760. Phone seems to react faster from sleep with this configuration. Definitely boots faster as well...

Thanks dude, and thanks to all the other Devs out there that keep my G1 blazing fast :D
[G1 Android Development] drpfenderson:
Quick question - I would love to use just the media2sd features on my phone, but don't want any of the rest of the userinit.sh. I can't just change the other stuff to 0, or it shuts off the compcache that Cyanogen has by default now.

I would like to keep Cyanogen's native compcache settings, but still have media2sd functionality. I have tried editing the userinit.sh file to only have that section, but seem to be doing it wrong.

Tried this, but it doesn't seem to work:

#!/system/bin/sh
#

media2sd=1

# media to sd
MEDIA2SD()
{
if [ ${STATUS_CHK} -eq 0 ] && [ -d /system/media ] && [ ! -h /system/media ] && [ -e /system/sd/media ] && [ $media2sd -eq 1 ];
then
# fix the permissions
busybox chmod 777 /system/sd/media
for i in `ls -R /system/sd/media | grep ":" | sed "s/://"`;
do
cd $i;
busybox chmod 777 $i;
for j in `ls $i`;
do
busybox chmod 666 $j;
done
done

busybox mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
busybox rm -rf /system/media;
busybox ln -s /system/sd/media /system/media;
busybox mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system
fi;
}

#main program
parse_args $*

MEDIA2SD;

exit 0;

Would anyone be able to help me with this mission?
[G1 Android Development] warburto:
su

sh /system/sd/userinit.sh -s

sh: Can't open /system/sd/userinit.sh

Ok, here's where I'm confused. The newest Cyanogen doesn't need a userinit.sh file in order to run. The "can't open" message seems to be in line with this, probably because there isn't a userinit.sh file present on the phone. Any thoughts?
[G1 Android Development] drpfenderson:
Wait...so I've kept looking, and it seem that when a userinit.sh is present, the default compcache settings are disabled. Is this true?
[G1 Android Development] miketaylor00:
There is an sh file somewhere that does this. On xROM it is /system/bin/swap -s. I'm not sure what file is used for Cyan.