[Q] VM and OOM Tweaks in Init.d - HTC Sensation

Hello all,
Ive noticed a LOT of custom Sensation builds including these init.d tweaks, and although Ive tested them, I cant find a major difference in usage. Actually, IMO they actually complicate memory usage a bit. THat being said, they are included in a LOT of ROMS so I figured Id askm if someone more knowledgeable can chime in, share a lil bit about them, what they do, why they are doing it, etc. Just trying to find out if these are worth including in my own set-up. Thanks!
VM Tweaks
Code:
#!/system/bin/sh
echo "50" > /proc/sys/vm/swappiness
echo "10" > /proc/sys/vm/vfs_cache_pressure
echo "500" > /proc/sys/vm/dirty_expire_centisecs
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs
echo "90" > /proc/sys/vm/dirty_ratio
echo "5" > /proc/sys/vm/dirty_background_ratio
OOM Tweaks
Code:
#!/system/bin/sh
echo "0,3,5,7,14,15" > /sys/module/lowmemorykiller/parameters/adj;
echo "1536,3072,4096,20992,23040,25088" > /sys/module/lowmemorykiller/parameters/minfree;
echo "0" > /proc/sys/vm/oom_kill_allocating_task;
echo "0" > /proc/sys/vm/panic_on_oom;
busybox sysctl -w kernel.panic_on_oops=1;
busybox sysctl -w kernel.panic=0;

Related

[Tweaks] Build.prop and init.d tweaks for Speed,Perfomance and Battery life

Intro
Tweaks build.prop and init.d for Speed,Perfomance and Battery life​
Build.prop Tweaks
Code:
# Raise JPG quality to 100%
ro.media.enc.jpeg.quality=100
# VM Heapsize; 178MB RAM = 32 is better
dalvik.vm.heapsize=32m
# Render UI with GPU
debug.sf.hw=1
# Decrease dialing out delay
ro.telephony.call_ring.delay=0
# Helps scrolling responsiveness
windowsmgr.max_events_per_sec=150
# Save battery
wifi.supplicant_scan_interval=180
pm.sleep_mode=1
ro.ril.disable.power.collapse=0
# Disable debugging notify icon on statusbar
persist.adb.notify=0
# Increase overall touch responsiveness
debug.performance.tuning=1
video.accelerate.hw=1
# Photo and video recording quality tweak (2.3 Rom only)
ro.media.dec.jpeg.memcap=8000000
ro.media.enc.hprof.vid.bps=800000
# Photo and video recording quality tweak (2.2 Rom only)
ro.media.dec.jpeg.memcap=10000000
ro.media.enc.hprof.vid.bps=1000000
# Photo and video recording quality tweak (Official ROM only)
ro.media.dec.jpeg.memcap=10000000
ro.media.enc.hprof.vid.bps=1600000
# Internet tweaks
ro.ril.hsxpa=2
ro.ril.gprsclass=12
ro.ril.hep=1
ro.ril.hsdpa.category=10
ro.ril.enable.3g.prefix=1
ro.ril.htcmaskw1.bitmask=4294967295
ro.ril.htcmaskw1=14449
ro.ril.hsupa.category=6
ro.ril.def.agps.mode=2
ro.ril.def.agps.feature=1
ro.ril.enable.sdr=1
ro.ril.enable.gea3=1
ro.ril.enable.fd.plmn.prefix=23402,23410,23411
ro.ril.enable.a52=1
ro.ril.enable.a53=1
ro.ril.enable.dtm=1
# NetSpeed tweaks
net.tcp.buffersize.default=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,16384,256960
# Disable blackscreen issue after a call
ro.lge.proximity.delay=25
mot.proximity.delay=25
# Fix some application issues
ro.kernel.android.checkjni=0
# Phone will not wake up from hitting the volume rocker
ro.config.hwfeature_wakeupkey=0
# Force button lights on when screen is on
ro.mot.buttonlight.timeout=0
# Disable boot animation for faster boot
debug.sf.nobootanimation=1
# Enable Stagefright helps stream Video and Music Faster
media.stagefright.enable-player=true
media.stagefright.enable-meta=true
media.stagefright.enable-scan=true
media.stagefright.enable-http=true
init.d tweaks ​Download Init.dtweaks.rar and choose 99Tweaks for balance option and 99XTweaks for aggressive tweaks
Init.d tweaks contain
LowmemoryKiller Tweaks Balance
Code:
echo "0,3,5,7,14,15" > /sys/module/lowmemorykiller/parameters/adj
echo "1536,2048,6656,7168,7680,8192" > /sys/module/lowmemorykiller/parameters/minfree
echo "0" > /proc/sys/kernel/panic
echo "0" > /proc/sys/vm/oom_kill_allocating_task
echo "0" > /proc/sys/vm/panic_on_oom
echo "1" > /proc/sys/kernel/panic_on_oops
echo "0" > /proc/sys/kernel/panic
LowmemoryKiller Tweaks aggressive
Code:
echo "0,3,5,7,14,15" > /sys/module/lowmemorykiller/parameters/adj
echo "2560,4096,6144,15360,17920,20480" > /sys/module/lowmemorykiller/parameters/minfree
echo "0" > /proc/sys/kernel/panic
echo "0" > /proc/sys/vm/oom_kill_allocating_task
echo "0" > /proc/sys/vm/panic_on_oom
echo "1" > /proc/sys/kernel/panic_on_oops
echo "0" > /proc/sys/kernel/panic
IPv4 tweaks
Code:
echo "0" > /proc/sys/net/ipv4/tcp_timestamps;
echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse;
echo "1" > /proc/sys/net/ipv4/tcp_sack;
echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle;
echo "1" > /proc/sys/net/ipv4/tcp_window_scaling;
echo "5" > /proc/sys/net/ipv4/tcp_keepalive_probes;
echo "30" > /proc/sys/net/ipv4/tcp_keepalive_intvl;
echo "30" > /proc/sys/net/ipv4/tcp_fin_timeout;
echo "404480" > /proc/sys/net/core/wmem_max;
echo "404480" > /proc/sys/net/core/rmem_max;
echo "256960" > /proc/sys/net/core/rmem_default;
echo "256960" > /proc/sys/net/core/wmem_default;
echo "4096,16384,404480" > /proc/sys/net/ipv4/tcp_wmem;
echo "4096,87380,404480" > /proc/sys/net/ipv4/tcp_rmem;
Dalvik VM tweaks
Code:
echo "4096" > /proc/sys/vm/min_free_kbytes
echo "0" > /proc/sys/vm/oom_kill_allocating_task;
echo "0" > /proc/sys/vm/panic_on_oom;
echo "0" > /proc/sys/vm/laptop_mode;
echo "0" > /proc/sys/vm/swappiness
echo "50" > /proc/sys/vm/vfs_cache_pressure
echo "90" > /proc/sys/vm/dirty_ratio
echo "70" > /proc/sys/vm/dirty_background_ratio
Battery Tweaks
Code:
echo "500" > /proc/sys/vm/dirty_expire_centisecs
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs
Note:If you have init.d problem or if not have init.d folder try add this line at hw_config.sh
Balance Tweaks
Code:
# Low memory killer tweaks
echo "0,3,5,7,14,15" > /sys/module/lowmemorykiller/parameters/adj
echo "1536,2048,6656,7168,7680,8192" > /sys/module/lowmemorykiller/parameters/minfree
echo "0" > /proc/sys/kernel/panic
echo "0" > /proc/sys/vm/oom_kill_allocating_task
echo "0" > /proc/sys/vm/panic_on_oom
echo "1" > /proc/sys/kernel/panic_on_oops
echo "0" > /proc/sys/kernel/panic
IPV4 tweaks
echo "0" > /proc/sys/net/ipv4/tcp_timestamps
echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse
echo "1" > /proc/sys/net/ipv4/tcp_sack
echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle
echo "1" > /proc/sys/net/ipv4/tcp_window_scaling
echo "5" > /proc/sys/net/ipv4/tcp_keepalive_probes
echo "30" > /proc/sys/net/ipv4/tcp_keepalive_intvl
echo "30" > /proc/sys/net/ipv4/tcp_fin_timeout
echo "404480" > /proc/sys/net/core/wmem_max
echo "404480" > /proc/sys/net/core/rmem_max
echo "256960" > /proc/sys/net/core/rmem_default
echo "256960" > /proc/sys/net/core/wmem_default
echo "4096,16384,404480" > /proc/sys/net/ipv4/tcp_wmem
echo "4096,87380,404480" > /proc/sys/net/ipv4/tcp_rmem
Dalvik VM tweaks
echo "4096" > /proc/sys/vm/min_free_kbytes
echo "0" > /proc/sys/vm/oom_kill_allocating_task
echo "0" > /proc/sys/vm/panic_on_oom
echo "0" > /proc/sys/vm/laptop_mode
echo "0" > /proc/sys/vm/swappiness
echo "50" > /proc/sys/vm/vfs_cache_pressure
echo "90" > /proc/sys/vm/dirty_ratio
echo "70" > /proc/sys/vm/dirty_background_ratio
Battery tweaks
echo "500" > /proc/sys/vm/dirty_expire_centisecs
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs
Aggressive Tweaks
Code:
# Low memory killer
echo "0,3,5,7,14,15" > /sys/module/lowmemorykiller/parameters/adj
echo "2560,4096,6144,15360,17920,20480" > /sys/module/lowmemorykiller/parameters/minfree
echo "0" > /proc/sys/kernel/panic
echo "0" > /proc/sys/vm/oom_kill_allocating_task
echo "0" > /proc/sys/vm/panic_on_oom
echo "1" > /proc/sys/kernel/panic_on_oops
echo "0" > /proc/sys/kernel/panic
# IPV4 tweaks
echo "0" > /proc/sys/net/ipv4/tcp_timestamps
echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse
echo "1" > /proc/sys/net/ipv4/tcp_sack
echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle
echo "1" > /proc/sys/net/ipv4/tcp_window_scaling
echo "5" > /proc/sys/net/ipv4/tcp_keepalive_probes
echo "30" > /proc/sys/net/ipv4/tcp_keepalive_intvl
echo "30" > /proc/sys/net/ipv4/tcp_fin_timeout
echo "404480" > /proc/sys/net/core/wmem_max
echo "404480" > /proc/sys/net/core/rmem_max
echo "256960" > /proc/sys/net/core/rmem_default
echo "256960" > /proc/sys/net/core/wmem_default
echo "4096,16384,404480" > /proc/sys/net/ipv4/tcp_wmem
echo "4096,87380,404480" > /proc/sys/net/ipv4/tcp_rmem
# Dalvik VM tweaks
echo "4096" > /proc/sys/vm/min_free_kbytes
echo "0" > /proc/sys/vm/oom_kill_allocating_task
echo "0" > /proc/sys/vm/panic_on_oom
echo "0" > /proc/sys/vm/laptop_mode
echo "0" > /proc/sys/vm/swappiness
echo "50" > /proc/sys/vm/vfs_cache_pressure
echo "90" > /proc/sys/vm/dirty_ratio
echo "70" > /proc/sys/vm/dirty_background_ratio
# Battery tweaks
echo "500" > /proc/sys/vm/dirty_expire_centisecs
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs
Reserved for Future use
Last reserved OK
hate to break it to you, but looks like most of the things you have here can be found in this thread:
http://forum.xda-developers.com/showthread.php?t=1227269
Thank, please keep developing...
Will the build.prop tweaks still work on ICS?
Nice scripts they are working but if you want them to be safe and without conflicts try removing the lmk settings before Ram differs on most phones
Example: Galaxy ace has 278 mb of ram and Lg optimus one has 512 (Basically is 478 or something).Those lmk settings will mess LG's ram
[email protected] said:
Nice scripts they are working but if you want them to be safe and without conflicts try removing the lmk settings before Ram differs on most phones
Example: Galaxy ace has 278 mb of ram and Lg optimus one has 512 (Basically is 478 or something).Those lmk settings will mess LG's ram
Click to expand...
Click to collapse
Actually, LMK settings should be standard as it represents free RAM (rather than total available RAM).
Only thing that matters for an LMK is that it should be tweaked along the Dalvik LMK. Only tweaking one or the other makes the LMK inefficient.
Hi what I would like to know is that the netspeed tweaks do those help in the edge speed. Also the internet tweaks do i need to enter all of those for the edge speed gain or only the line with the gprs.
how to use this script , i mean how to save this file??
dinesam said:
how to use this script , i mean how to save this file??
Click to expand...
Click to collapse
Bookmark it Ctrl+D or Subscribe to this topic.
Sent from my C6603 using xda app-developers app

[Q] VM and OOM Tweaks in Init.d

Hello all,
Ive noticed a LOT of custom Sensation builds including these init.d tweaks, and although Ive tested them, I cant find a major difference in usage. Actually, IMO they actually complicate memory usage a bit. THat being said, they are included in a LOT of ROMS so I figured Id askm if someone more knowledgeable can chime in, share a lil bit about them, what they do, why they are doing it, etc. Just trying to find out if these are worth including in my own set-up. Thanks!
VM Tweaks
Code:
#!/system/bin/sh
echo "50" > /proc/sys/vm/swappiness
echo "10" > /proc/sys/vm/vfs_cache_pressure
echo "500" > /proc/sys/vm/dirty_expire_centisecs
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs
echo "90" > /proc/sys/vm/dirty_ratio
echo "5" > /proc/sys/vm/dirty_background_ratio
OOM Tweaks
Code:
#!/system/bin/sh
echo "0,3,5,7,14,15" > /sys/module/lowmemorykiller/parameters/adj;
echo "1536,3072,4096,20992,23040,25088" > /sys/module/lowmemorykiller/parameters/minfree;
echo "0" > /proc/sys/vm/oom_kill_allocating_task;
echo "0" > /proc/sys/vm/panic_on_oom;
busybox sysctl -w kernel.panic_on_oops=1;
busybox sysctl -w kernel.panic=0;

[Q] Faux kernel init.post_boot.sh customization

This is, i´m reeally noob, and do it just for fun and have muy sensation the way I like, so I want to know just the basics to do that.
Just added stock frequencies to init.post_boot.sh of faux kernel, and I wondering, how to control the transitions or steps of the frecuency scaling, I found this lines, but really don´t know if they will work. Some of them are already in my file. But I don´t know whats the function of sampling_rate, up_threshold, and sampling_down_factor, and if they will work on intellidemand governor.
echo 40000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
echo 40000 > /sys/devices/system/cpu/cpu1/cpufreq/ondemand/sampling_rate
echo "60000" > /sys/devices/system/cpu/cpu0/cpufreq/conservative/sampling_rate
echo "60000" > /sys/devices/system/cpu/cpu1/cpufreq/conservative/sampling_rate
echo 80 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold
echo 80 > /sys/devices/system/cpu/cpu1/cpufreq/ondemand/up_threshold
echo "95" > /sys/devices/system/cpu/cpu0/cpufreq/conservative/up_threshold
echo "95" > /sys/devices/system/cpu/cpu1/cpufreq/conservative/up_threshold
echo "1" > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
echo "2" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
echo "20" > /sys/devices/system/cpu/cpufreq/ondemand/down_differential
chown system /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
chown system /sys/devices/system/cpu/cpu1/cpufreq/ondemand/sampling_rate
echo "192000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo "192000" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
chown system /sys/devices/system/cpu/cpu0/online
chown system /sys/devices/system/cpu/cpu1/online
chown system /sys/power/perflock
Thanks!

[MOD][REF]Set governer on boot with init.d

Since everyones asking how to set a governor on boot, heres a sample of my init.d script that sets "on demand" with max frequency 1400000 (1.4GHZ) and min frequency 200000 (0.2GHZ) on boot, if you would like to use it or modify it let me know, i dont bite and im one to help! enjoy!!
here's the guidelines!
100000 = 1GHZ
DOWNLOAD
This is my Script to set / tweak my Governor on my XZ.
It's easy to handle, i guess.
#!/system/bin/sh
LOG_FILE=/data/Init.d_Tweaks.log
sleep 60
# Set Scaling Governor
GOVERNOR="conservative"
echo $GOVERNOR > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo $GOVERNOR > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo $GOVERNOR > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo $GOVERNOR > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
echo "$GOVERNOR Governor is running" | tee -a $LOG_FILE;
# Set Min & Max Frequency
# 384000 486000 594000 702000 810000 918000 1026000 1134000 1242000 1350000 1458000 1512000
CPU_MIN="384000"
CPU_MAX="1242000"
echo $CPU_MIN > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo $CPU_MAX > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo $CPU_MIN > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
echo $CPU_MAX > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
echo $CPU_MIN > /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq
echo $CPU_MAX > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
echo $CPU_MIN > /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq
echo $CPU_MAX > /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq
echo "Min / Max Frequency is set to $CPU_MIN / $CPU_MAX" | tee -a $LOG_FILE;
# Set IO Sheduler
SHEDULER="deadline"
echo $SHEDULER > /sys/block/mmcblk0/queue/scheduler
echo $SHEDULER > /sys/block/mmcblk1/queue/scheduler
echo "$SHEDULER Sheduler is running" | tee -a $LOG_FILE;
# Set SD Cache
READ_AHEAD_KB="512"
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/254:0/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/254:1/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/179:0/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/179:32/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/0:18/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:0/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:1/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:2/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:3/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:4/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:5/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:6/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:7/read_ahead_kb
echo "256" > /sys/devices/virtual/bdi/default/read_ahead_kb
echo "SD Cache is set to $READ_AHEAD_KB kb" | tee -a $LOG_FILE;
# Tweak Governor
# Ondemand
if [ -d "/sys/devices/system/cpu/cpufreq/$GOVERNOR" ]; then
# Ondemand Tweaked
echo "90" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo "85" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
echo "85" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
echo "75000" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
echo "2" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
echo "384000" > /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
echo "1242000" > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
echo "10" > /sys/devices/system/cpu/cpufreq/ondemand/down_differential
echo "35" > /sys/devices/system/cpu/cpufreq/ondemand/freq_step
# Ondemand Battery
# echo "95" /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
# echo "85" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
# echo "85" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
# echo "120000" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
# echo "1" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
# echo "384000" > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
# echo "1026000" > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
# echo "5" > /sys/devices/system/cpu/cpufreq/ondemand/down_differential
# echo "10" > /sys/devices/system/cpu/cpufreq/ondemand/freq_step
# Ondemand Performance
# echo "70" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
# echo "60" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
# echo "60" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
# echo "50000" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
# echo "2" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
# echo "702000" > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
# echo "1512000" > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
# echo "15" > /sys/devices/system/cpu/cpufreq/ondemand/down_differential
# echo "50" > /sys/devices/system/cpu/cpufreq/ondemand/freq_step
fi;
# Interactive
if [ -d "/sys/devices/system/cpu/cpufreq/$GOVERNOR" ]; then
# Interactive Tweaked
echo "90" > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo "1242000" > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
echo "20000" > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo "30000" > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
# Interactive Battery
# echo "95" > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
# echo "1026000" > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
# echo "10000" > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
# echo "40000" > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
# Interactive Performance
# echo "80" > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
# echo "1512000" > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
# echo "40000" > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
# echo "20000" > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
fi;
# Conservative
if [ -d "/sys/devices/system/cpu/cpufreq/$GOVERNOR" ]; then
# Conservative Tweaked
echo "90" > /sys/devices/system/cpu/cpufreq/conservative/up_threshold
echo "60000" > /sys/devices/system/cpu/cpufreq/conservative/sampling_rate
echo "3" > /sys/devices/system/cpu/cpufreq/conservative/sampling_down_factor
echo "30" > /sys/devices/system/cpu/cpufreq/conservative/down_threshold
echo "15" > /sys/devices/system/cpu/cpufreq/conservative/freq_step
# Conservative Battery
# echo "95" > /sys/devices/system/cpu/cpufreq/conservative/up_threshold
# echo "120000" > /sys/devices/system/cpu/cpufreq/conservative/sampling_rate
# echo "1" > /sys/devices/system/cpu/cpufreq/conservative/sampling_down_factor
# echo "40" > /sys/devices/system/cpu/cpufreq/conservative/down_threshold
# echo "10" > /sys/devices/system/cpu/cpufreq/conservative/freq_step
# Conservative Performance
# echo "60" > /sys/devices/system/cpu/cpufreq/conservative/up_threshold
# echo "40000" > /sys/devices/system/cpu/cpufreq/conservative/sampling_rate
# echo "5" > /sys/devices/system/cpu/cpufreq/conservative/sampling_down_factor
# echo "20" > /sys/devices/system/cpu/cpufreq/conservative/down_threshold
# echo "25" > /sys/devices/system/cpu/cpufreq/conservative/freq_step
fi;
echo "$GOVERNOR Governor is Tweaked" | tee -a $LOG_FILE;
# Custom Kernel Tweaks
# reduce / increase [mv] for all Frequencys
# echo "-90000" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
# Set GPU Governor
# echo "simple" > /sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/pwrscale/trustzone/governor
# Set GPU Clock
# echo "325000000" > /sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/max_gpuclk
# Swap / Tap 2 Wake
# echo "0" > /sys/android_touch/doubletap2wake
# echo "0" > /sys/android_touch/sweep2wake
# echo "Custom Kernel Settings are applied" | tee -a $LOG_FILE;
echo " " | tee -a $LOG_FILE;
echo "@ $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
echo " " | tee -a $LOG_FILE;
Gesendet von meinem C6603 mit Tapatalk
HSD-Pilot said:
This is my Script to set / tweak my Governor on my XZ.
It's easy to handle, i guess.
#!/system/bin/sh
LOG_FILE=/data/Init.d_Tweaks.log
sleep 60
# Set Scaling Governor
GOVERNOR="conservative"
echo $GOVERNOR > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo $GOVERNOR > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo $GOVERNOR > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo $GOVERNOR > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
echo "$GOVERNOR Governor is running" | tee -a $LOG_FILE;
# Set Min & Max Frequency
# 384000 486000 594000 702000 810000 918000 1026000 1134000 1242000 1350000 1458000 1512000
CPU_MIN="384000"
CPU_MAX="1242000"
echo $CPU_MIN > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo $CPU_MAX > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo $CPU_MIN > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
echo $CPU_MAX > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
echo $CPU_MIN > /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq
echo $CPU_MAX > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
echo $CPU_MIN > /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq
echo $CPU_MAX > /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq
echo "Min / Max Frequency is set to $CPU_MIN / $CPU_MAX" | tee -a $LOG_FILE;
# Set IO Sheduler
SHEDULER="deadline"
echo $SHEDULER > /sys/block/mmcblk0/queue/scheduler
echo $SHEDULER > /sys/block/mmcblk1/queue/scheduler
echo "$SHEDULER Sheduler is running" | tee -a $LOG_FILE;
# Set SD Cache
READ_AHEAD_KB="512"
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/254:0/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/254:1/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/179:0/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/179:32/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/0:18/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:0/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:1/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:2/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:3/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:4/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:5/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:6/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:7/read_ahead_kb
echo "256" > /sys/devices/virtual/bdi/default/read_ahead_kb
echo "SD Cache is set to $READ_AHEAD_KB kb" | tee -a $LOG_FILE;
# Tweak Governor
# Ondemand
if [ -d "/sys/devices/system/cpu/cpufreq/$GOVERNOR" ]; then
# Ondemand Tweaked
echo "90" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo "85" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
echo "85" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
echo "75000" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
echo "2" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
echo "384000" > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
echo "1242000" > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
echo "10" > /sys/devices/system/cpu/cpufreq/ondemand/down_differential
echo "35" > /sys/devices/system/cpu/cpufreq/ondemand/freq_step
# Ondemand Battery
# echo "95" /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
# echo "85" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
# echo "85" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
# echo "120000" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
# echo "1" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
# echo "384000" > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
# echo "1026000" > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
# echo "5" > /sys/devices/system/cpu/cpufreq/ondemand/down_differential
# echo "10" > /sys/devices/system/cpu/cpufreq/ondemand/freq_step
# Ondemand Performance
# echo "70" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
# echo "60" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
# echo "60" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
# echo "50000" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
# echo "2" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
# echo "702000" > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
# echo "1512000" > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
# echo "15" > /sys/devices/system/cpu/cpufreq/ondemand/down_differential
# echo "50" > /sys/devices/system/cpu/cpufreq/ondemand/freq_step
fi;
# Interactive
if [ -d "/sys/devices/system/cpu/cpufreq/$GOVERNOR" ]; then
# Interactive Tweaked
echo "90" > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo "1242000" > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
echo "20000" > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo "30000" > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
# Interactive Battery
# echo "95" > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
# echo "1026000" > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
# echo "10000" > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
# echo "40000" > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
# Interactive Performance
# echo "80" > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
# echo "1512000" > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
# echo "40000" > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
# echo "20000" > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
fi;
# Conservative
if [ -d "/sys/devices/system/cpu/cpufreq/$GOVERNOR" ]; then
# Conservative Tweaked
echo "90" > /sys/devices/system/cpu/cpufreq/conservative/up_threshold
echo "60000" > /sys/devices/system/cpu/cpufreq/conservative/sampling_rate
echo "3" > /sys/devices/system/cpu/cpufreq/conservative/sampling_down_factor
echo "30" > /sys/devices/system/cpu/cpufreq/conservative/down_threshold
echo "15" > /sys/devices/system/cpu/cpufreq/conservative/freq_step
# Conservative Battery
# echo "95" > /sys/devices/system/cpu/cpufreq/conservative/up_threshold
# echo "120000" > /sys/devices/system/cpu/cpufreq/conservative/sampling_rate
# echo "1" > /sys/devices/system/cpu/cpufreq/conservative/sampling_down_factor
# echo "40" > /sys/devices/system/cpu/cpufreq/conservative/down_threshold
# echo "10" > /sys/devices/system/cpu/cpufreq/conservative/freq_step
# Conservative Performance
# echo "60" > /sys/devices/system/cpu/cpufreq/conservative/up_threshold
# echo "40000" > /sys/devices/system/cpu/cpufreq/conservative/sampling_rate
# echo "5" > /sys/devices/system/cpu/cpufreq/conservative/sampling_down_factor
# echo "20" > /sys/devices/system/cpu/cpufreq/conservative/down_threshold
# echo "25" > /sys/devices/system/cpu/cpufreq/conservative/freq_step
fi;
echo "$GOVERNOR Governor is Tweaked" | tee -a $LOG_FILE;
# Custom Kernel Tweaks
# reduce / increase [mv] for all Frequencys
# echo "-90000" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
# Set GPU Governor
# echo "simple" > /sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/pwrscale/trustzone/governor
# Set GPU Clock
# echo "325000000" > /sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/max_gpuclk
# Swap / Tap 2 Wake
# echo "0" > /sys/android_touch/doubletap2wake
# echo "0" > /sys/android_touch/sweep2wake
# echo "Custom Kernel Settings are applied" | tee -a $LOG_FILE;
echo " " | tee -a $LOG_FILE;
echo "@ $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
echo " " | tee -a $LOG_FILE;
Gesendet von meinem C6603 mit Tapatalk
Click to expand...
Click to collapse
thats pretty neat, mines just a basic compared to yours
HSD-Pilot said:
This is my Script to set / tweak my Governor on my XZ.
...
Click to expand...
Click to collapse
do i only have to change ondemand to hotplug to work on hotplug governor?
Maximus1a said:
do i only have to change ondemand to hotplug to work on hotplug governor?
Click to expand...
Click to collapse
If your Kernel supports it, sure.
You can set any available Governor on your Phone.
Just edit
GOVERNOR="hotplug"
To tweak it, just search the Forum for available Values. My Phone doesn't support it, that's why it's not in the script.
Gesendet von meinem Full Android on C6603 mit Tapatalk 2
HSD-Pilot said:
This is my Script to set / tweak my Governor on my XZ.
It's easy to handle, i guess.
#!/system/bin/sh
LOG_FILE=/data/Init.d_Tweaks.log
sleep 60
# Set Scaling Governor
GOVERNOR="conservative"
echo $GOVERNOR > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo $GOVERNOR > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo $GOVERNOR > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo $GOVERNOR > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
echo "$GOVERNOR Governor is running" | tee -a $LOG_FILE;
# Set Min & Max Frequency
# 384000 486000 594000 702000 810000 918000 1026000 1134000 1242000 1350000 1458000 1512000
CPU_MIN="384000"
CPU_MAX="1242000"
echo $CPU_MIN > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo $CPU_MAX > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo $CPU_MIN > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
echo $CPU_MAX > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
echo $CPU_MIN > /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq
echo $CPU_MAX > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
echo $CPU_MIN > /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq
echo $CPU_MAX > /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq
echo "Min / Max Frequency is set to $CPU_MIN / $CPU_MAX" | tee -a $LOG_FILE;
# Set IO Sheduler
SHEDULER="deadline"
echo $SHEDULER > /sys/block/mmcblk0/queue/scheduler
echo $SHEDULER > /sys/block/mmcblk1/queue/scheduler
echo "$SHEDULER Sheduler is running" | tee -a $LOG_FILE;
# Set SD Cache
READ_AHEAD_KB="512"
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/254:0/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/254:1/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/179:0/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/179:32/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/0:18/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:0/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:1/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:2/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:3/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:4/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:5/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:6/read_ahead_kb
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:7/read_ahead_kb
echo "256" > /sys/devices/virtual/bdi/default/read_ahead_kb
echo "SD Cache is set to $READ_AHEAD_KB kb" | tee -a $LOG_FILE;
# Tweak Governor
# Ondemand
if [ -d "/sys/devices/system/cpu/cpufreq/$GOVERNOR" ]; then
# Ondemand Tweaked
echo "90" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo "85" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
echo "85" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
echo "75000" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
echo "2" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
echo "384000" > /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
echo "1242000" > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
echo "10" > /sys/devices/system/cpu/cpufreq/ondemand/down_differential
echo "35" > /sys/devices/system/cpu/cpufreq/ondemand/freq_step
# Ondemand Battery
# echo "95" /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
# echo "85" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
# echo "85" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
# echo "120000" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
# echo "1" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
# echo "384000" > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
# echo "1026000" > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
# echo "5" > /sys/devices/system/cpu/cpufreq/ondemand/down_differential
# echo "10" > /sys/devices/system/cpu/cpufreq/ondemand/freq_step
# Ondemand Performance
# echo "70" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
# echo "60" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
# echo "60" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
# echo "50000" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
# echo "2" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
# echo "702000" > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
# echo "1512000" > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
# echo "15" > /sys/devices/system/cpu/cpufreq/ondemand/down_differential
# echo "50" > /sys/devices/system/cpu/cpufreq/ondemand/freq_step
fi;
# Interactive
if [ -d "/sys/devices/system/cpu/cpufreq/$GOVERNOR" ]; then
# Interactive Tweaked
echo "90" > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo "1242000" > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
echo "20000" > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo "30000" > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
# Interactive Battery
# echo "95" > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
# echo "1026000" > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
# echo "10000" > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
# echo "40000" > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
# Interactive Performance
# echo "80" > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
# echo "1512000" > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
# echo "40000" > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
# echo "20000" > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
fi;
# Conservative
if [ -d "/sys/devices/system/cpu/cpufreq/$GOVERNOR" ]; then
# Conservative Tweaked
echo "90" > /sys/devices/system/cpu/cpufreq/conservative/up_threshold
echo "60000" > /sys/devices/system/cpu/cpufreq/conservative/sampling_rate
echo "3" > /sys/devices/system/cpu/cpufreq/conservative/sampling_down_factor
echo "30" > /sys/devices/system/cpu/cpufreq/conservative/down_threshold
echo "15" > /sys/devices/system/cpu/cpufreq/conservative/freq_step
# Conservative Battery
# echo "95" > /sys/devices/system/cpu/cpufreq/conservative/up_threshold
# echo "120000" > /sys/devices/system/cpu/cpufreq/conservative/sampling_rate
# echo "1" > /sys/devices/system/cpu/cpufreq/conservative/sampling_down_factor
# echo "40" > /sys/devices/system/cpu/cpufreq/conservative/down_threshold
# echo "10" > /sys/devices/system/cpu/cpufreq/conservative/freq_step
# Conservative Performance
# echo "60" > /sys/devices/system/cpu/cpufreq/conservative/up_threshold
# echo "40000" > /sys/devices/system/cpu/cpufreq/conservative/sampling_rate
# echo "5" > /sys/devices/system/cpu/cpufreq/conservative/sampling_down_factor
# echo "20" > /sys/devices/system/cpu/cpufreq/conservative/down_threshold
# echo "25" > /sys/devices/system/cpu/cpufreq/conservative/freq_step
fi;
echo "$GOVERNOR Governor is Tweaked" | tee -a $LOG_FILE;
# Custom Kernel Tweaks
# reduce / increase [mv] for all Frequencys
# echo "-90000" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
# Set GPU Governor
# echo "simple" > /sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/pwrscale/trustzone/governor
# Set GPU Clock
# echo "325000000" > /sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/max_gpuclk
# Swap / Tap 2 Wake
# echo "0" > /sys/android_touch/doubletap2wake
# echo "0" > /sys/android_touch/sweep2wake
# echo "Custom Kernel Settings are applied" | tee -a $LOG_FILE;
echo " " | tee -a $LOG_FILE;
echo "@ $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
echo " " | tee -a $LOG_FILE;
Gesendet von meinem C6603 mit Tapatalk
Click to expand...
Click to collapse
How to set minimum gpu frequency? Will this work?:
# echo "325000000" > /sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/min_gpuclk
:good:
@Ricky Divjakovski
Sorry for disturbing
Please give the script in the post or give a mirror link sir..
All your threads are very helpful
Thanks

Ideal Init for AOSP-based ROMs

I wrote this program because Android's init process on Qualcomm phones is absolutely terrible. It's full of things like the following hidden code segment:
Code:
if [ -f /sys/devices/soc0/soc_id ]; then
soc_id=`cat /sys/devices/soc0/soc_id`
else
soc_id=`cat /sys/devices/system/soc/soc0/id`
fi
if [ -f /sys/devices/f9967000.i2c/i2c-0/0-0072/enable_irq ]; then
echo 1 > /sys/devices/f9967000.i2c/i2c-0/0-0072/enable_irq
else
echo "doesn't find slimport enable_irq"
fi
case "$soc_id" in
"208" | "211" | "214" | "217" | "209" | "212" | "215" | "218" | "194" | "210" | "213" | "216")
for devfreq_gov in /sys/class/devfreq/qcom,cpubw*/governor
do
echo "cpubw_hwmon" > $devfreq_gov
done
echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "interactive" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo "interactive" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo "interactive" > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
#echo "20000 1400000:40000 1700000:20000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
echo 90 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo 1190400 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
echo 1 > /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
#echo "85 1500000:90 1800000:70" > /sys/devices/system/cpu/cpufreq/interactive/target_loads
echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo 20 > /sys/module/cpu_boost/parameters/boost_ms
#echo 1728000 > /sys/module/cpu_boost/parameters/sync_threshold
#echo 100000 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
echo 1497600 > /sys/module/cpu_boost/parameters/input_boost_freq
echo 40 > /sys/module/cpu_boost/parameters/input_boost_ms
#Set LGE Interactive-Grid parameters for G3 models
echo "20000 1100000:40000 1500000:20000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
echo "85 1500000:90" > /sys/devices/system/cpu/cpufreq/interactive/target_loads
echo 960000 > /sys/module/cpu_boost/parameters/sync_threshold
echo 0 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
echo 1 > /sys/devices/system/cpu/cpufreq/interactive/is_grid
echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/above_optimal_max_freq_delay
echo 960000 > /sys/devices/system/cpu/cpufreq/interactive/optimal_max_freq
echo 7 > /sys/devices/system/cpu/cpufreq/interactive/middle_grid_step
echo 37 > /sys/devices/system/cpu/cpufreq/interactive/middle_grid_load
echo 14 > /sys/devices/system/cpu/cpufreq/interactive/high_grid_step
echo 46 > /sys/devices/system/cpu/cpufreq/interactive/high_grid_load
echo 1000 > /sys/class/devfreq/g3-display.0/polling_interval
setprop ro.qualcomm.perf.cores_online 2
;;
*)
echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "ondemand" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo "ondemand" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo "ondemand" > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
echo 50000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
echo 90 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo 1 > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
echo 2 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/down_differential
echo 70 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
echo 3 > /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
echo 960000 > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
echo 960000 > /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
# even if scaling_max_freq go down because of themal mitigation, input_boost frequency does not go down.
# echo 1190400 > /sys/devices/system/cpu/cpufreq/ondemand/input_boost
echo 80 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
#Set LGE Ondemand-Grid parameters for msm8974aa
echo 960000 > /sys/devices/system/cpu/cpufreq/ondemand/optimal_max_freq
echo 7 > /sys/devices/system/cpu/cpufreq/ondemand/middle_grid_step
echo 40 > /sys/devices/system/cpu/cpufreq/ondemand/middle_grid_load
echo 14 > /sys/devices/system/cpu/cpufreq/ondemand/high_grid_step
echo 50 > /sys/devices/system/cpu/cpufreq/ondemand/high_grid_load
;;
esac
What is $soc_id equal to? Now we have to audit trail to see what and when $soc_id has been set to, which will open up another can of worms to see when it was initialized to, and what are the implications of having $soc_id set to a certain value, rather than another further down in the init process? Why can't we just extract all of the actual information to the boot process and leave the other junk (support for CPUs which are 5+ years old, unused features, etc) behind?
Enter Ideal Init. What Ideal Init is, consists of some changes to your device's stock kernel, and some changes to your device's stock ramdisk. Once you make the changes to the kernel and ramdisk, you create a boot.img with the new and updated kernel and ramdisk, and flash it to your device. The changes you just made to the kernel and ramdisk now allow the system calls made by your device's init.*.rc scripts and init shell scripts to be logged and dumped for later use.
From there you can dump your device's logs using the dmesg command, and run the ideal_init program on your computer to interpret these intercepted system calls and output a single valid init.<device>.rc. Then you can revert back to your original setup.
Basically, this program turns all of these init scripts and these init shell scripts and extracts only the information that was actually used in the boot process to create something like this
Check out the README for detailed instructions
https://github.com/JackpotClavin/Ideal-Init
Hope this helps the device bringup for future ROMs

Categories

Resources