[Samsung Epic 4G Touch] PhAkEer:
For those who need Ondemand

This os vitrually the same as the Pegasus script above;

#!/system/bin/sh
# ondemand
# I/O Settings
scheduler=deadline
read_ahead=5120
inode_blks=64
inode_goal=8
fifo_batch=14
read_expire=700
write_expire=2800
writes_starved=0

# CPU Freq Settings
min_freq=50
max_freq=1400
up_thresh=70
sampling=50000
sampling_factor=3
down_diff=20
freq_step=60
ignore_nice=0
io_is_busy=0

# Other settings
max_mb_scan=0
min_mb_scan=0
mb_stream_req=0
max_writeback_bump=128
req_order2=0
prealloc_mb=768
mali_runtime=2500
setprop debug.gr.swapinterval 0
setprop windowsmgr.max_events_per_sec 300

# Sysctl & Misc settings
LMK=-5,2,6,8,11,16
minfree=1024,6158,10000,16000,24000
Caches=3
Cluster=2
Reserve=97,82
FreeKb=40000
Dbackground=37
Dratio=18
Cpressure=2100
OverRatio=35
OrdShift=2
swappiness=30
Wcents=400
Rcents=1800
break=12

set -x
exec > /data/log/placebo.txt 2>&1
for j in $(/system/xbin/busybox mount | /system/xbin/busybox grep ext4 | /system/xbin/busybox cut -d " " -f3)
do
sync
/system/xbin/busybox mount -o remount,noatime,barrier=0,commit=5 $j
done
mount -o remount,rw,noatime,nobh,nodiratime,nodelalloc,noauto_da_alloc,barrier=0 /system /system
mount -o remount,noatime,nobh,nodiratime,nodelalloc,noauto_da_alloc,barrier=0,commit=0 /cache /cache
mount -o remount,noatime,nodiratime,delalloc,noauto_da_alloc,barrier=0,commit=0 /data /data
for i in /sys/fs/ext4/mmc*
do
echo "$max_mb_scan" > $i/mb_max_to_scan
echo "$min_mb_scan" > $i/mb_min_to_scan
echo "$inode_blks" > $i/inode_readahead_blks
echo "$inode_goal" > $i/inode_goal
echo "$mb_stream_req" > $i/mb_stream_req
echo "$max_writeback_bump" > $i/max_writeback_mb_bump
echo "$preaoc_mb" > $i/mb_group_prealloc
echo "$req_order2" > $i/mb_order2_req
done
echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
for i in /sys/devices/system/cpu/cpufreq/ondemand
do
echo "$up_thresh" > $i/up_threshold
echo "$sampling" > $i/sampling_rate
echo "$sampling_factor" > $i/sampling_down_factor
echo "$down_diff" > $i/down_differential
echo "$freq_step" > $i/freq_step
echo "$ignore_nice" > $i/ignore_nice_load
done
for i in /sys/devices/virtual/bdi/*/read_ahead_kb
do
echo "$read_ahead" > $i
done
for i in /sys/class/block/*/queue
do
echo "$scheduler" > $i/scheduler
echo "$read_ahead" > $i/read_ahead_kb
if [[ -e $i/iosched/fifo_batch ]]
then
echo "$fifo_batch" > $i/iosched/fifo_batch
echo "$read_expire" > $i/iosched/read_expire
echo "$write_expire" > $i/iosched/write_expire
echo "$writes_starved" > $i/iosched/writes_starved;
else
echo ""
fi
done
echo "$mali_runtime" > /sys/module/mali/parameters/mali_max_job_runtime
for i in "adj -17"; do
{
case $i in
""/init | oom_adj | -17 | rlimit_nice) ( [ -f proc/1/oom_$i ]; echo /proc/1/oom_$i""return 0 );;
esac
}
{
setprop ro.com.android.phone_$i
setprop ro.com.android.phonesky_$i
setprop ro.com.android.settings_$i
setprop ro.com.android.systemui_$i
setprop ro.android.process.media_$i
setprop ro.android.process.acore_$i
setprop ro.com.sec.twframework-res_$i
setprop persist.home.app_$i
}
done
setprop persist.process.apm_sleep_adj -5
echo "$min_freq"\000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo "$max_freq"\000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
for i in "/sys/module/lowmemorykiller/parameters/adj=$LMK
/sys/module/lowmemorykiller/parameters/minfree=$minfree
/proc/1/oom_adj=-17
vm.drop_caches=$Caches
vm.page-cluster=$Cluster
vm.highmem_is_dirtyable=1
vm.lowmem_reserve_ratio=$Reserve
vm.min_free_kbytes=$FreeKb
vm.oom_kill_allocating_task=1
vm.panic_on_oom=0
vm.dirty_background_ratio=$Dbackground
vm.dirty_ratio=$Dratio
vm.vfs_cache_pressure=$Cpressure
vm.overcommit_memory=1
vm.overcommit_ratio=$OverRatio
vm.min_free_order_shift=$OrdShift
vm.laptop_mode=5
vm.block_dump=0
vm.swappiness=$swappiness
vm.dirty_writeback_centisecs=$Wcents
vm.dirty_expire_centisecs=$Rcents
fs.lease-break-time=$break
fs.perf_event_max_sample_rate=150000
kernel.random.read_wake_threshold=256
kernel.random.write_wake_threshold=512
kernel.randomize_va_space=1";
do
sysctl -e -w $i
done;

exit