[COLLECTION] Scripts&Explaination [06/07]

Search This thread

hastalafiesta

Senior Member
Nov 30, 2012
844
1,814
26
Italy
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.

BATTERY
Code:
[COLOR="Red"]deepest_state[/COLOR]: 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.

[COLOR="Blue"]echo "4" > /d/cpuidle/deepest_state;[/COLOR]
Code:
[COLOR="Red"]dirty_expire_centisecs[/COLOR]: 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!

[COLOR="Blue"]echo "5000" > /proc/sys/vm/dirty_expire_centisecs;[/COLOR]
Code:
[COLOR="Red"]dirty_writeback_centisecs[/COLOR]: In hundredths of a second, how often threads should wake up to write data back out to disk.

[COLOR="Blue"]echo "5000" > /proc/sys/vm/dirty_writeback_centisecs;[/COLOR]
Code:
[COLOR="Red"]laptop_mode[/COLOR]: is a special page writeback strategy intended to optimize battery life by minimizing memory activity. My tip is to take it off.

[COLOR="Blue"]echo "0" > /proc/sys/vm/laptop_mode;[/COLOR]

Code:
[COLOR="Red"]max_ac_c[/COLOR]: 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.

[COLOR="blue"]echo "400" > /sys/kernel/abb-charger/max_ac_c;[/COLOR]

PERFORMANCE

Code:
[COLOR="Red"]mali_l2_max_reads[/COLOR]: Set max reads that mali l2 can do.

[COLOR="Blue"]echo "48" > /sys/module/mali/parameters/mali_l2_max_reads;[/COLOR]

Code:
[COLOR="Red"]mali_debug_level[/COLOR]: Disabling it, you can gain some performance improvements.

[COLOR="Blue"]echo "0" > /sys/module/mali/parameters/mali_debug_level;[/COLOR]

Code:
[COLOR="Red"]fsync[/COLOR]: 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.

[COLOR="Blue"]echo "0" > /sys/kernel/fsync/mode;[/COLOR] // To enable (default)
[COLOR="Blue"]echo "1" > /sys/kernel/fsync/mode;[/COLOR] // To disable
[COLOR="Blue"]echo "2" > /sys/kernel/fsync/mode;[/COLOR]  // Dynamic (writes data only when screen is off)

Code:
[COLOR="Red"]vfs_cache_pressure[/COLOR]: 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:

[COLOR="Blue"]echo "10" > /proc/sys/vm/vfs_cache_pressure;[/COLOR]

Code:
[COLOR="red"]page-cluster[/COLOR]: 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.

[COLOR="Blue"]echo "3" > /proc/sys/vm/page-cluster;[/COLOR]

SD CARD

Code:
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.

[COLOR="Blue"]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;[/COLOR]



Code:
[COLOR="Blue"]This should block charging when phone reaches 100% and recharge phone when is 50% (Thanks to [user=2855249]@bobfrantic[/user]).
THIS IS ONLY WORKING WITH COCORE KERNEL[/COLOR]

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
 
Last edited:

coffeecore

Senior Member
Dec 6, 2013
1,029
380
@hastalafiesta

No DL on OP?

---------- Post added at 02:56 AM ---------- Previous post was at 02:47 AM ----------

Do you have Purging of assets and kernel sampage merging enabled manually in AOSPA with this script? Or only KSM?

Thanks :)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 7
    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.

    BATTERY
    Code:
    [COLOR="Red"]deepest_state[/COLOR]: 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.
    
    [COLOR="Blue"]echo "4" > /d/cpuidle/deepest_state;[/COLOR]
    Code:
    [COLOR="Red"]dirty_expire_centisecs[/COLOR]: 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!
    
    [COLOR="Blue"]echo "5000" > /proc/sys/vm/dirty_expire_centisecs;[/COLOR]
    Code:
    [COLOR="Red"]dirty_writeback_centisecs[/COLOR]: In hundredths of a second, how often threads should wake up to write data back out to disk.
    
    [COLOR="Blue"]echo "5000" > /proc/sys/vm/dirty_writeback_centisecs;[/COLOR]
    Code:
    [COLOR="Red"]laptop_mode[/COLOR]: is a special page writeback strategy intended to optimize battery life by minimizing memory activity. My tip is to take it off.
    
    [COLOR="Blue"]echo "0" > /proc/sys/vm/laptop_mode;[/COLOR]

    Code:
    [COLOR="Red"]max_ac_c[/COLOR]: 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.
    
    [COLOR="blue"]echo "400" > /sys/kernel/abb-charger/max_ac_c;[/COLOR]

    PERFORMANCE

    Code:
    [COLOR="Red"]mali_l2_max_reads[/COLOR]: Set max reads that mali l2 can do.
    
    [COLOR="Blue"]echo "48" > /sys/module/mali/parameters/mali_l2_max_reads;[/COLOR]

    Code:
    [COLOR="Red"]mali_debug_level[/COLOR]: Disabling it, you can gain some performance improvements.
    
    [COLOR="Blue"]echo "0" > /sys/module/mali/parameters/mali_debug_level;[/COLOR]

    Code:
    [COLOR="Red"]fsync[/COLOR]: 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.
    
    [COLOR="Blue"]echo "0" > /sys/kernel/fsync/mode;[/COLOR] // To enable (default)
    [COLOR="Blue"]echo "1" > /sys/kernel/fsync/mode;[/COLOR] // To disable
    [COLOR="Blue"]echo "2" > /sys/kernel/fsync/mode;[/COLOR]  // Dynamic (writes data only when screen is off)

    Code:
    [COLOR="Red"]vfs_cache_pressure[/COLOR]: 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:
    
    [COLOR="Blue"]echo "10" > /proc/sys/vm/vfs_cache_pressure;[/COLOR]

    Code:
    [COLOR="red"]page-cluster[/COLOR]: 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.
    
    [COLOR="Blue"]echo "3" > /proc/sys/vm/page-cluster;[/COLOR]

    SD CARD

    Code:
    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.
    
    [COLOR="Blue"]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;[/COLOR]



    Code:
    [COLOR="Blue"]This should block charging when phone reaches 100% and recharge phone when is 50% (Thanks to [user=2855249]@bobfrantic[/user]).
    THIS IS ONLY WORKING WITH COCORE KERNEL[/COLOR]
    
    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