[Galaxy S II Original Android Development] nightranger73:
Ok... I just wanted to share my settings... Why? Because there's nothing left from stock :-P (except from 1000 mhz which it seems to be locked)

Awake frequencies:

1408 1280 1152 1000 768 384 192 128

Sleep frequencies

640 384 192 128 (running 128 min 640 max only)

Smoothness and power saving

If you want to use it in your phone please make sure to check voltages (or lock it to 1000 mhz min/max to avoid frequency changes that could lead to system hang and check each step with setcpu/vc)

Other changes could be made on last part of script where you can made governor tweaks for each state (awake/sleep)

This script is only modification of scripts on first page

#!/system/bin/sh
LOG_FILE=/sdcard/Tweaks.log
rm -f $LOG_FILE

echo "Syiah Kernel performance tweaker script" | tee -a $LOG_FILE;

ACPUFREQ="1408 1280 1152 1000 768 512 256 128 "
ACPUVOLT="1350 1250 1175 1100 1000 950 900 875 "
AWAKEMIN="128000"
AWAKEMAX="1408000"
AWAKEGOVERNOR="ondemand"

SCPUFREQ="1480 1352 1200 1000 640 384 192 128 "
SCPUVOLT="1400 1300 1200 1100 975 950 900 875 "
SLEEPMIN="128000"
SLEEPMAX="640000"
SLEEPGOVERNOR="conservative"

SCHEDULER="deadline"

GPUFREQ="100 160"
GPUVOLT="850000 950000"

BUFFERS="0 1 2 2 2 2 2 2"
BUFENABLE=enabled
POWERSAVING="1"

HOTPLUGLOADL="40"
HOTPLUGLOADH="70"
SCROFFLOADL="60"
SCROFFLOADH="85"

CHARGING="750 750 550"
SDREADAHEAD="256"

MINBL="24"
MAXGAMMA="30"

echo "Script started at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
echo "------------------------------------------------------" | tee -a $LOG_FILE;
MMC=/sys/block/mmc*

echo "Setting table of frequencies" | tee -a $LOG_FILE;
echo $ACPUFREQ;
echo $ACPUFREQ > /sys/devices/system/cpu/cpu0/cpufreq/freq_table;

echo "Setting UV table" | tee -a $LOG_FILE;
echo $ACPUVOLT;
echo $ACPUVOLT > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table;

echo $AWAKEGOVERNOR > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor;
echo $AWAKEMAX > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;
echo $AWAKEMIN > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq;

echo "Set buffer multipliers" | tee -a $LOG_FILE;
echo $BUFFERS $BUFENABLE;
echo $BUFFERS > /sys/devices/system/cpu/cpu0/cpufreq/busfreq_static;
echo $BUFENABLE > /sys/devices/system/cpu/cpu0/cpufreq/busfreq_static;

echo "Set CPU power saving to $POWERSAVING" | tee -a $LOG_FILE;
echo $POWERSAVING > /sys/devices/system/cpu/sched_mc_power_savings;

echo "Set GPU clocks to $GPUFREQ" | tee -a $LOG_FILE;
echo $GPUFREQ > /sys/devices/virtual/misc/gpu_clock_control/gpu_control;

echo "GPU voltages to $GPUVOLT " | tee -a $LOG_FILE;
echo $GPUVOLT > /sys/devices/virtual/misc/gpu_voltage_control/gpu_control;

echo "Charging current to $CHARGING" | tee -a $LOG_FILE;
echo $CHARGING > /sys/devices/virtual/misc/charge_current/charge_current;

echo "Setting 2nd core hotplug level tweaks" | tee -a $LOG_FILE;
echo $HOTPLUGLOADL > /sys/module/pm_hotplug/parameters/loadl;
echo $HOTPLUGLOADH > /sys/module/pm_hotplug/parameters/loadh;
echo $SCROFFLOADL > /sys/module/pm_hotplug/parameters/loadl_scroff;
echo $SCROFFLOADH > /sys/module/pm_hotplug/parameters/loadh_scroff;

echo "Setting display brightness curve and gamma " | tee -a $LOG_FILE;
echo $MINBL > /sys/class/misc/brightness_curve/min_bl;
echo $MAXGAMMA > /sys/class/misc/brightness_curve/max_gamma;

echo "Set Scheduler for mmc to $SCHEDULER" | tee -a $LOG_FILE;
for i in $MMC; do
echo $SCHEDULER > $i/queue/scheduler;
done;

# Optimize non-rotating storage;
for i in $MMC;
do
if [ -e $i/queue/rotational ];
then
echo 0 > $i/queue/rotational;
fi;
if [ -e $i/queue/nr_requests ];
then
echo 8192 > $i/queue/nr_requests; # for starters: keep it sane
fi;
#CFQ specific
if [ -e $i/queue/iosched/back_seek_penalty ];
then
echo 1 > $i/queue/iosched/back_seek_penalty;
fi;
#CFQ specific
if [ -e $i/queue/iosched/low_latency ];
then
echo 1 > $i/queue/iosched/low_latency;
fi;
#CFQ Specific
if [ -e $i/queue/iosched/slice_idle ];
then
echo 0 > $i/queue/iosched/slice_idle; # previous: 1
fi;
# deadline/VR/SIO scheduler specific
if [ -e $i/queue/iosched/fifo_batch ];
then
echo 1 > $i/queue/iosched/fifo_batch;
fi;
if [ -e $i/queue/iosched/writes_starved ];
then
echo 1 > $i/queue/iosched/writes_starved;
fi;
#CFQ specific
if [ -e $i/queue/iosched/quantum ];
then
echo 8 > $i/queue/iosched/quantum;
fi;
#VR Specific
if [ -e $i/queue/iosched/rev_penalty ];
then
echo 1 > $i/queue/iosched/rev_penalty;
fi;
if [ -e $i/queue/rq_affinity ];
then
echo "1" > $i/queue/rq_affinity;
fi;
echo "0" > $i/queue/iostats;
if [ -e $i/queue/read_ahead_kb ];
then
echo $SDREADAHEAD > $i/queue/read_ahead_kb;
fi;
echo "0" > $i/queue/nomerges;
echo "128" > $i/queue/max_sectors_kb;
done;

if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ];
then
echo "1024" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
fi;

if [ -e /sys/devices/virtual/bdi/179:8/read_ahead_kb ];
then
echo "1024" > /sys/devices/virtual/bdi/179:8/read_ahead_kb;
fi;

if [ -e /sys/devices/virtual/bdi/179:28/read_ahead_kb ];
then
echo "1024" > /sys/devices/virtual/bdi/179:28/read_ahead_kb;
fi;

if [ -e /sys/devices/virtual/bdi/179:33/read_ahead_kb ];
then
echo "1024" > /sys/devices/virtual/bdi/179:33/read_ahead_kb;
fi;

if [ -e /sys/devices/virtual/bdi/default/read_ahead_kb ];
then
echo "256" > /sys/devices/virtual/bdi/default/read_ahead_kb;
fi;

# TWEAKS: MEMORY SETTINGS for general operation + zcache/zram usage
# optimizing the system for zcache & zram usage & general VM (compatible with all ROMs)

echo 60 > /proc/sys/vm/swappiness;
echo 3 > /proc/sys/vm/page-cluster;

# make sure we don't use laptop-mode
echo 0 > /proc/sys/vm/laptop_mode;

echo 1 > /proc/sys/vm/vfs_cache_pressure;
echo 1 > /proc/sys/vm/overcommit_memory;
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;

(while [ 1 ];
do
# settings for while the screen is on / usage
AWAKE=`cat /sys/power/wait_for_fb_wake`;
if [ $AWAKE = "awake" ]; then
echo $ACPUFREQ > /sys/devices/system/cpu/cpu0/cpufreq/freq_table;
echo $ACPUVOLT > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table;
echo $AWAKEGOVERNOR > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor;
echo $AWAKEMAX > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;
echo $AWAKEMIN > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq;
# YOUR TWEAKS GOES HERE
# *********************
echo 3000 > /proc/sys/vm/dirty_expire_centisecs;
echo 500 > /proc/sys/vm/dirty_writeback_centisecs;
echo 65 > /proc/sys/vm/dirty_background_ratio;
echo 80 > /proc/sys/vm/dirty_ratio;
echo 1 > /proc/sys/vm/vfs_cache_pressure;
# END OF TWEAKS
log -p i -t screenstate_scaling "*** awake ***: switching CPU frequency governor to -> $AWAKEGOVERNOR"
AWAKE=;
fi;

# settings for while the screen is off
SLEEPING=`cat /sys/power/wait_for_fb_sleep`;
if [ $SLEEPING = "sleeping" ]; then
echo $SCPUFREQ > /sys/devices/system/cpu/cpu0/cpufreq/freq_table;
echo $SCPUVOLT > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table;
echo $SLEEPGOVERNOR > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor;
echo $SLEEPMAX > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;
echo $SLEEPMIN > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq;

# YOUR TWEAKS HERE
# ****************

echo "85" > /sys/devices/system/cpu/cpufreq/conservative/up_threshold;
echo "50" > /sys/devices/system/cpu/cpufreq/conservative/down_threshold;
echo "10" > /sys/devices/system/cpu/cpufreq/conservative/freq_step;

echo 6000 > /proc/sys/vm/dirty_expire_centisecs;
echo 6000 > /proc/sys/vm/dirty_writeback_centisecs;
echo 75 > /proc/sys/vm/dirty_background_ratio;
echo 90 > /proc/sys/vm/dirty_ratio;
echo 10 > /proc/sys/vm/vfs_cache_pressure;

# END OF TWEAKS

log -p i -t screenstate_scaling "*** sleeping ***: switching CPU frequency governor to -> $SLEEPGOVERNOR"
SLEEPING=;
fi;
done &);

echo "------------------------------------------------------" | tee -a $LOG_FILE;
echo "Script finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;

Inviato dal mio GT-I9100 usando Tapatalk