[Miscellaneous Android Development] bpushpak:
Here you go

#!/system/bin/sh

# Collection of tweaks found in XDA & Linux forums

# Values are Optimized for LG PRADA 3 (P940)

# To apply to any other phone, verify the stock values and change these values based on that

# Values that are not relevant for this phone or does not change much have been removed

# Contact me in XDA forums for explnation of the orginal values and values applied here along with the once that are not relevant or working in Prada

# bpushpak @ XDA

# busybox mount -o remount,rw -t auto /system

# busybox mount -o remount,rw -t auto

# Disable normalize sleeper

#################################

mount -t debugfs none /sys/kernel/debug

echo NO_NORMALIZED_SLEEPER > /sys/kernel/debug/sched_features;

# Start Remove Logger

##############################

busybox rm /dev/log/main

# kernel Tweaks

##############################

echo "2350" > /proc/sys/kernel/msgmni;

echo "16384" > /proc/sys/kernel/msgmax;

echo "8192" > /proc/sys/kernel/shmmni;

echo "750000" > /proc/sys/kernel/sched_min_granularity_ns;

echo "256" > /proc/sys/kernel/random/write_wakeup_threshold;

echo "128" > /proc/sys/kernel/random/read_wakeup_threshold;

echo "0" > /proc/sys/kernel/panic;

# Filesystem tweaks

##############################

echo "256" > /proc/sys/fs/inotify/max_user_instances;

echo "32000" > /proc/sys/fs/inotify/max_queued_events;

echo "15" > /proc/sys/fs/lease-break-time;

#if mounting is not successful then manual mounting will do the thing for you

mount -o remount,noatime,nodiratime auto /

mount -o remount,noatime,nodiratime auto /dev

mount -o remount,noatime,nodiratime auto /proc

mount -o remount,noatime,nodiratime auto /sys

mount -o remount,noatime,nodiratime auto /mnt/asec

mount -o remount,noatime,nodiratime auto /system

mount -o remount,noatime,nodiratime auto /data

mount -o remount,noatime,nodiratime auto /cache

mount -o remount,noatime,nodiratime auto /mnt/sdcard

mount -o remount,noatime,nodiratime auto /mnt/secure/asec

mount -o remount,noatime,nodiratime auto /mnt/sdcard/.android_secure

#flags every mounted partition as non rotational and increases it's cache size for more read speed

#Works only when the complete OS is not loaded

MTD=`ls -d /sys/block/mtd*`;

LOOP=`ls -d /sys/block/loop*`;

RAM=`ls -d /sys/block/ram*`;

MMC=`ls -d /sys/block/mmc*`;

for j in $MTD $LOOP $RAM

do

echo "0" > $j/queue/rotational;

echo "4096" > $j/queue/read_ahead_kb;

done;

for a in $MTD $MMC

do

echo "512" > $a/queue/nr_requests;

done;

# VM tweaks

##############################

echo "1" > /proc/sys/vm/oom_kill_allocating_task;

echo "0" > /proc/sys/vm/panic_on_oom;

echo "5" > /proc/sys/vm/vm.panic_on_oom;

echo "8" > /proc/sys/vm/page-cluster;

echo "3" > /proc/sys/vm/drop_caches;

echo "4096" > /proc/sys/vm/min_free_kbytes;

echo "10" > /proc/sys/vm/vfs_cache_pressure;

echo "70" > /proc/sys/vm/dirty_background_ratio;

echo "90" > /proc/sys/vm/dirty_ratio;

echo "3000" > /proc/sys/vm/dirty_writeback_centisecs;

echo "1200" > /proc/sys/vm/dirty_expire_centisecs;

echo "0" > /proc/sys/vm/swappiness;

# Clear Junk Caches And Junk Data

#######################################

busybox find /data/data -type d -iname "*cache*" -exec busybox rm -f {}/* ';' -exec echo "Cleared {}" ';'

rm -f /data/local/*.apk

rm -f /data/local/tmp/*.apk

rm -f /data/*.log

rm -f /data/log/*.log

rm -f /cache/*.*

rm -f /cache/recovery/*.*

rm -f /data/system/dropbox/*.txt

rm -f /data/backup/pending/*.tmp

rm -f /data/tombstones/*.*

# Background Process To Optimize Dialer Process

##################################################

(while [ 1 ];

do

sleep 10;

MAX_PHONE;

done &);

# Remove Lag When Answering Phone Calls

#############################################

MAX_PHONE()

{

pidphone=`pidof com.android.phone`;

if [ $pidphone ]; # Wait for com.android.phone to start;

then

echo -17 > /proc/$pidphone/oom_adj; # exclude com.android.phone from oom-killer;

renice -20 $pidphone; # set highest nice level for com.android.phone;

log -p i -t SSSwitch_v0.8 "*** MAX phone *** set oom_adj(-17) and nice(-20) for com.android.phone";

exit;

else

sleep 5;

MAX_PHONE;

fi;

}

# MicroSD Card Speed Tweak

################################

READ_AHEAD_KB="4096"

if [ -e /sys/devices/virtual/bdi/1:0/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:0/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/1:1/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:1/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/1:2/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:2/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/1:3/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:3/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/1:4/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:4/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/1:5/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:5/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/1:6/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:6/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/1:7/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:7/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/1:8/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:8/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/1:9/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:9/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/1:10/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:10/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/1:11/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:11/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/1:12/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:12/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/1:13/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:13/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/1:14/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:14/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/1:15/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/1:15/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/7:0/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:0/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/7:1/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:1/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/7:2/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:2/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/7:3/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:3/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/7:4/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:4/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/7:5/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:5/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/7:6/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:6/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/7:7/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:7/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/179:0/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/179:20/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/179:20/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/179:40/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/179:40/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/179:60/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/179:60/read_ahead_kb

fi

if [ -e /sys/devices/virtual/bdi/default/read_ahead_kb ]; then

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/default/read_ahead_kb

fi

# Disable IO Stats To Reduce Overhead

###########################################

if [ -e $i/queue/iostats ];

then

echo "0" > $i/queue/iostats;

fi;

# Begin Misc Tweaks

###############################

#faster scroll speed

echo "64" > /sys/bus/hid/drivers/magicmouse/module/parameters/scroll_speed;

#Sets read and write on I/O sceduler to max.

echo "4096" > /sys/block/mmcblk1/queue/read_ahead_kb;

#will merge tasks if able

echo "1" > /sys/block/mmcblk0/queue/nomerges;

echo "1" > /sys/block/mmcblk1/queue/nomerges;

echo "1" > /sys/block/mmcblk0/queue/low_latency;

echo "1" > /sys/block/mmcblk1/queue/low_latency;

echo "256" > /sys/block/mmcblk0/queue/nr_requests;

echo "256" > /sys/block/mmcblk1/queue/nr_requests;

# Begin 3G download Speed Tweak

###################################

echo "0" > /proc/sys/net/ipv4/tcp_timestamps;

echo "262142" > /proc/sys/net/core/rmem_max;

echo "221184" > /proc/sys/net/core/rmem_default;

echo "262142" > /proc/sys/net/core/wmem_max;

echo "221184" > /proc/sys/net/core/wmem_default;

echo "0" > /proc/sys/net/ipv4/tcp_ecn;

echo "1" > /proc/sys/net/ipv4/tcp_rfc1337;

echo "1" > /proc/sys/net/ipv4/tcp_no_metrics_save;

echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse;

echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle;

echo 5 > /proc/sys/net/ipv4/tcp_keepalive_probes;

echo 30 > /proc/sys/net/ipv4/tcp_keepalive_intvl;

echo 30 > /proc/sys/net/ipv4/tcp_fin_timeout;

#DB vacum & reindex

####################################

for i in \

`find /data/data -iname "*.db"`

do \

sqlite3 $i 'VACUUM;';

sqlite3 $i 'REINDEX;';

done;

I am yet too get this verified or changed for CM10. Will take some more time as I want the phone to get settled into the new OS :)