[Gen9 Android Development] momojuro:
[MENTION=2008455]kuskro[/MENTION] [MENTION=5325651]St4mi[/MENTION] [MENTION=4238451]ladalgigi[/MENTION] [MENTION=5934180]rosch1968[/MENTION] [MENTION=4239010]biggoof75[/MENTION]

Hello ! I updated my performance script again, after a lot of tests. Those ROW scheduler's values work better than the previous ones, as they are more effecient in multitasking situations. I also doubled entropy read_/write_wakeup_threshold values, basing on subjective evaluations. Finally, I changed txqueuelen (you can search about it) to 100 based on objective network speed tests on WLAN, this reduces network buffer-bloat by 90% and optimizes throughput speed.

I will see if I can do better ! To update the file, you will need to put it in init.d folder (which is present in /system/etc) and to change its permissions to : rwxrwxrwx (Tap for a moment on the file, choose Settings and then choose Permissions). :)

Like always, its content :

#!/system/bin/sh

####################
# Perfect mount #
##################

# Sysfs mount options
busybox mount -o remount,nosuid,nodev,noatime,nodiratime -t auto /;
busybox mount -o remount,nosuid,nodev,noatime,nodiratime -t auto /proc;
busybox mount -o remount,nosuid,nodev,noatime,nodiratime -t auto /sys;
busybox mount -o remount,nosuid,nodev,noatime,nodiratime -t auto /sys/kernel/debug;
busybox mount -o remount,nosuid,nodev,noatime,nodiratime -t auto /mnt/shell/emulated;

# Partition & sdcard mount options
busybox mount -o remount,nosuid,nodev,noatime,nodiratime,barrier=0,noauto_da_alloc -t auto /data;
busybox mount -o remount,nosuid,nodev,noatime,nodiratime,barrier=0,noauto_da_alloc -t auto /cache;
busybox mount -o remount,nodev,noatime,nodiratime,barrier=0,noauto_da_alloc -t auto /system;
for i in /storage/emulated/*; do
busybox mount -o remount,nosuid,nodev,noatime,nodiratime -t auto $i;
busybox mount -o remount,nosuid,nodev,noatime,nodiratime -t auto $i/Android/obb;
done;

########################
# Disable debugging #
######################

echo "0" > /sys/module/wakelock/parameters/debug_mask;
echo "0" > /sys/module/userwakelock/parameters/debug_mask;
echo "0" > /sys/module/earlysuspend/parameters/debug_mask;
echo "0" > /sys/module/alarm/parameters/debug_mask;
echo "0" > /sys/module/alarm_dev/parameters/debug_mask;
echo "0" > /sys/module/binder/parameters/debug_mask;

##############
# Entropy #
###########

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

#fs tweaks
echo "10" > /proc/sys/fs/lease-break-time;

###################
# I/O Scheduler #
#################

# General queue tweaks
for i in /sys/block/*/queue; do
echo "512" > $i/nr_requests;
echo "512" > $i/read_ahead_kb;
echo "0" > $i/add_random;
echo "0" > $i/rotational;
echo "0" > $i/iostats;
echo "2" > $i/rq_affinity;
# ROW scheduler settings
echo "75" > $i/iosched/hp_read_quantum;
echo "75 > $i/iosched/rp_read_quantum;
echo "6" > $i/iosched/hp_swrite_quantum;
echo "4" > $i/iosched/rp_swrite_quantum;
echo "3" > $i/iosched/rp_write_quantum;
echo "2" > $i/iosched/lp_read_quantum;
echo "1" > $i/iosched/lp_swrite_quantum;
echo "20" > $i/iosched/read_idle;
echo "35" > $i/iosched/read_idle_freq;
done;

# suitable configuration to help reduce network latency
echo 2 > /proc/sys/net/ipv4/tcp_ecn;
echo 1 > /proc/sys/net/ipv4/tcp_sack;
echo 1 > /proc/sys/net/ipv4/tcp_dsack;
echo 1 > /proc/sys/net/ipv4/tcp_timestamps;

# reduce txqueuelen to 100 to optimize upload / download speeds
for i in /sys/class/net/*; do
echo 100 > $i/tx_queue_len;
done;[/hide]