2014年11月23日星期日

init.d script to tweak interactive governor and deadline scheduler for NX785QC8G

init.d script to tweak interactive governor and deadline scheduler for NX785QC8G

ONLY FOR NX785QC8G!!

I wrote this init.d script to tweak the default values of the interactive governor and switch to a tweaked deadline io scheduler. seems to improve responsiveness quite a bit, and battery life is good too. I'm at 34% batt right now with 5 hours screen on time and constant WiFi use. YMMV but feel free to try it for yourself! just place this file in /etc/init.d and change owner and group to root, then chmod 755. here is the code, script file is attached - DON'T FORGET TO REMOVE THE .TXT EXTENSION!!

Code:
#!/system/bin/sh


echo "deadline" > /sys/block/mmcblk0/queue/scheduler
chmod 444 /sys/block/mmcblk0/queue/scheduler


echo "1" > /sys/block/mmcblk0/queue/add_random
chmod 444 /sys/block/mmcblk0/queue/add_random
echo "1" > /sys/block/mmcblk0/queue/iostats
chmod 444 /sys/block/mmcblk0/queue/iostats
echo "0" > /sys/block/mmcblk0/queue/nomerges
chmod 444 /sys/block/mmcblk0/queue/nomerges
echo "0" > /sys/block/mmcblk0/queue/rotational
chmod 444 /sys/block/mmcblk0/queue/rotational
echo "1" > /sys/block/mmcblk0/queue/rq_affinity
chmod 444 /sys/block/mmcblk0/queue/rq_affinity


echo "4" > /sys/block/mmcblk0/queue/iosched/fifo_batch
chmod 444 /sys/block/mmcblk0/queue/iosched/fifo_batch
echo "1" > /sys/block/mmcblk0/queue/iosched/front_merges
chmod 444 /sys/block/mmcblk0/queue/iosched/front_merges
echo "500" > /sys/block/mmcblk0/queue/iosched/read_expire
chmod 444 /sys/block/mmcblk0/queue/iosched/read_expire
echo "3000" > /sys/block/mmcblk0/queue/iosched/write_expire
chmod 444 /sys/block/mmcblk0/queue/iosched/write_expire
echo "3" > /sys/block/mmcblk0/queue/iosched/writes_starved
chmod 444 /sys/block/mmcblk0/queue/iosched/writes_starved


echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
chmod 444 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor


echo "15000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
chmod 444 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
echo "0" > /sys/devices/system/cpu/cpufreq/interactive/boost
chmod 444 /sys/devices/system/cpu/cpufreq/interactive/boost
echo "60000" > /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
chmod 444 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
echo "70" > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
chmod 444 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo "1200000" > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
chmod 444 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
echo "60000" > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
chmod 444 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo "90" > /sys/devices/system/cpu/cpufreq/interactive/target_loads
chmod 444 /sys/devices/system/cpu/cpufreq/interactive/target_loads
echo "15000" > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
chmod 444 /sys/devices/system/cpu/cpufreq/interactive/timer_rate
echo "60000" > /sys/devices/system/cpu/cpufreq/interactive/timer_slack
chmod 444 /sys/devices/system/cpu/cpufreq/interactive/timer_slack
Attached Files Attached Files

没有评论:

发表评论