[COLLECTION] Scripts&Explaination [06/07]
This is a collection of echo scripts with optimized values for our janice (i9070&i9070P).
I will add an explanation for every tweak to make things clear.
deepest_state: this allow you to set a sleep level. As far as I know, 3-4-5 states are available; major is the state, better your phone will sleep and so less battery draining (obviously while screen is off).
A tip: I think that 4 state is the best, it doesn't cause troubles on the contrary of the 5 level that may causes problems, but it is stable if using ONDEMAND as governor.
echo "4" > /d/cpuidle/deepest_state;
dirty_expire_centisecs: In hundredths of a second, how old data must be to be written out next time a thread wakes to perform periodic writeback. As I know, permitted values are 100 to 5000, but if I'm wrong, don't esitate to correct me!
echo "5000" > /proc/sys/vm/dirty_expire_centisecs;
dirty_writeback_centisecs: In hundredths of a second, how often threads should wake up to write data back out to disk.
echo "5000" > /proc/sys/vm/dirty_writeback_centisecs;
laptop_mode: is a special page writeback strategy intended to optimize battery life by minimizing memory activity. My tip is to take it off.
echo "0" > /proc/sys/vm/laptop_mode;
max_ac_c: Is a CoCore kernel feature that allow to edit the chargin' values. Safe values are among 100 to 700, put an higher value may damage your battery, instead putting lower value (400 for example) it will preserve battery life.
echo "400" > /sys/kernel/abb-charger/max_ac_c;
mali_l2_max_reads: Set max reads that mali l2 can do.
echo "48" > /sys/module/mali/parameters/mali_l2_max_reads;
mali_debug_level: Disabling it, you can gain some performance improvements.
echo "0" > /sys/module/mali/parameters/mali_debug_level;
fsync: Fsync is an android capability that always writes data out to the memory preventing data loss. If you have a stable system, disable it and you'll have: more battery life, faster system. But be careful you may loose all of your data if your phone shuts down suddenly.
echo "0" > /sys/kernel/fsync/mode; // To enable (default)
echo "1" > /sys/kernel/fsync/mode; // To disable
echo "2" > /sys/kernel/fsync/mode; // Dynamic (writes data only when screen is off)
vfs_cache_pressure: File system cache is really more important than the block cache above in dirty ratio and dirty background ratio, so we really want the kernel to use up much more of the RAM for file system cache, this will increase the performance of the system without sacrificing performance at the application level. Lower value is better (100 is the max), so for example:
echo "10" > /proc/sys/vm/vfs_cache_pressure;
page-cluster: This controls the number of pages which are written to swap in a single attempt.
It is a logarithmic value - setting it to zero means "1 page", setting it to 1 means "2 pages", setting it to 2 means "4 pages", etc.
echo "3" > /proc/sys/vm/page-cluster;
The default value of sd card cache is 128, but some various tests have estabilished that if you increase this value to 2048, you'll have improvements in write and read sd card operations.
echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
echo "2048" > /sys/devices/virtual/bdi/7:0/read_ahead_kb;
echo "2048" > /sys/devices/virtual/bdi/7:1/read_ahead_kb;
echo "2048" > /sys/devices/virtual/bdi/7:2/read_ahead_kb;
echo "2048" > /sys/devices/virtual/bdi/7:3/read_ahead_kb;
echo "2048" > /sys/devices/virtual/bdi/7:4/read_ahead_kb;
echo "2048" > /sys/devices/virtual/bdi/7:5/read_ahead_kb;
echo "2048" > /sys/devices/virtual/bdi/7:6/read_ahead_kb;
echo "2048" > /sys/devices/virtual/bdi/7:7/read_ahead_kb;
echo "2048" > /sys/devices/virtual/bdi/default/read_ahead_kb;
This should block charging when phone reaches 100% and recharge phone when is 50% (Thanks to @bobfrantic).
THIS IS ONLY WORKING WITH COCORE KERNEL
echo on > /sys/kernel/abb-fg/fg_cyc
echo dischar=100 > /sys/kernel/abb-fg/fg_cyc
echo rechar=50 > /sys/kernel/abb-fg/fg_cyc
I will add more tweaks, stay tuned guys