Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,742,296 Members 51,839 Now Online
XDA Developers Android and Mobile Development Forum

[COLLECTION] Scripts&Explaination [06/07]

Tip us?
 
hastalafiesta
Old
(Last edited by hastalafiesta; 12th July 2014 at 08:55 PM.)
#1  
Senior Member - OP
Thanks Meter 608
Posts: 593
Join Date: Nov 2012
Location: Molfetta
Prompt [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.

BATTERY
Code:
Select Code
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;
Code:
Select Code
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;
Code:
Select Code
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;
Code:
Select Code
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;
Code:
Select Code
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;
PERFORMANCE

Code:
Select Code
mali_l2_max_reads: Set max reads that mali l2 can do.

echo "48" > /sys/module/mali/parameters/mali_l2_max_reads;
Code:
Select Code
mali_debug_level: Disabling it, you can gain some performance improvements.

echo "0" > /sys/module/mali/parameters/mali_debug_level;
Code:
Select Code
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)
Code:
Select Code
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;
Code:
Select Code
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;
SD CARD

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

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;


Code:
Select Code
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
The Following 7 Users Say Thank You to hastalafiesta For This Useful Post: [ Click to Expand ]
 
coffeecore
Old
#2  
coffeecore's Avatar
Senior Member
Thanks Meter 151
Posts: 640
Join Date: Dec 2013
Location: Amsterdam
@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
 
hastalafiesta
Old
#3  
Senior Member - OP
Thanks Meter 608
Posts: 593
Join Date: Nov 2012
Location: Molfetta
Quote:
Originally Posted by coffeecore View Post
@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
I will also add here a script. Nope both (ksm and purging of assets) disabled
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes