Hello everyone!
I made this script for myself from stuff I found online. But when I put it into init.d the phone stops booting before the cyanogen logo comes up (on the second LG logo). I can't figure out why... However it works (the settings are applied) if I run it with adb once the phone is booted.
This is the script:
Code:
#!/system/bin/sh
echo "0,1,2,4,6,15" > /sys/module/lowmemorykiller/parameters/adj;
echo "1536,2048,4096,10240,12800,15360" > /sys/module/lowmemorykiller/parameters/minfree;
# vm management tweaks:
echo "4096" > /proc/sys/vm/min_free_kbytes;
echo "1" > /proc/sys/vm/oom_kill_allocating_task;
echo "0" > /proc/sys/vm/panic_on_oom;
echo "0" > /proc/sys/vm/laptop_mode;
echo "0" > /proc/sys/vm/swappiness;
echo "70" > /proc/sys/vm/vfs_cache_pressure;
echo "15" > /proc/sys/vm/dirty_ratio;
echo "3" > /proc/sys/vm/dirty_background_ratio;
# misc kernel tweaks:
echo "8" > /proc/sys/vm/page-cluster;
#echo "64000" > /proc/sys/kernel/msgmni;
#echo "64000" > /proc/sys/kernel/msgmax;
echo "10" > /proc/sys/fs/lease-break-time;
#echo "500,512000,64,2048" > /proc/sys/kernel/sem;
# CPU scheduler tweaks:
#echo "1000000" > /proc/sys/kernel/sched_latency_ns;
#echo "25000" > /proc/sys/kernel/sched_wakeup_granularity_ns;
#echo "100000" > /proc/sys/kernel/sched_min_granularity_ns;
echo "-1" > /proc/sys/kernel/sched_rt_runtime_us ;
echo "100000" > /proc/sys/kernel/sched_rt_period_us;
echo "95000" > /proc/sys/kernel/sched_rt_runtime_us;
# battery tweaks:
echo "3000" > /proc/sys/vm/dirty_expire_centisecs;
echo "500" > /proc/sys/vm/dirty_writeback_centisecs;
echo "500" > /proc/sys/vm/dirty_expire_centisecs;
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs;
echo "0" > /proc/sys/vm/oom_kill_allocating_task;
tune2fs -o journal_data_writeback /dev/block/mmcblk0p1;
tune2fs -O ^has_journal /dev/block/mmcblk0p1;
tune2fs -o journal_data_writeback /dev/block/mmcblk0p2;
tune2fs -O ^has_journal /dev/block/mmcblk0p2;
tune2fs -f -o journal_data_writeback /dev/block/mmcblk0p8;
tune2fs -f -O ^has_journal /dev/block/mmcblk0p8;
mount -o remount,noatime,noauto_da_alloc,nodev,nodiratime,barrier=0,nobh /system;
mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodiratime,barrier=0,nobh /data;
mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodiratime,barrier=0,nobh /cache;
rm -f /data/system/userbehavior.db;
chmod 400 /data/system/usagestats/;
chmod 400 /data/system/appusagestats/;
rm -f /dev/log/main;
echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
echo "2048" > /sys/devices/virtual/bdi/default/read_ahead_kb;
setprop net.dns1 8.8.8.8;
setprop net.dns2 8.8.4.4;
setprop windowsmgr.support_rotation_270 true;
setprop persist.service.pcsync.enable 0;
setprop persist.service.lgospd.enable 0;
setprop user.feature.flex true;
setprop user.feature.lgdrm false;
setprop user.feature.lgresource false;
setprop user.feature.lgpoweroff false;
setprop user.feature.ls_event false;
setprop user.feature.ls_normal false;
setprop user.feature.sui false;
setprop media.stagefright.enable-player false;
setprop media.stagefright.enable-meta true;
setprop media.stagefright.enable-scan true;
setprop media.stagefright.enable-http true;
echo "0" > /proc/sys/net/ipv4/tcp_timestamps;
echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse;
echo "1" > /proc/sys/net/ipv4/tcp_sack;
echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle;
echo "1" > /proc/sys/net/ipv4/tcp_window_scaling;
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;
echo "404480" > /proc/sys/net/core/wmem_max;
echo "404480" > /proc/sys/net/core/rmem_max;
echo "256960" > /proc/sys/net/core/rmem_default;
echo "256960" > /proc/sys/net/core/wmem_default;
echo "4096,16384,404480" > /proc/sys/net/ipv4/tcp_wmem;
echo "4096,87380,404480" > /proc/sys/net/ipv4/tcp_rmem;
MAX_PHONE()
{
pidphone=`pidof com.android.phone`;
if [ $pidphone ];
then
/system/xbin/echo "-17" > /proc/$pidphone/oom_adj;
renice -20 $pidphone;
exit;
else
MAX_PHONE;
fi;
}
MAX_ACORE()
{
pidacore=`pidof android.process.acore`;
if [ $pidacore ];
then
/system/xbin/echo "-17" > /proc/$pidacore/oom_adj;
renice -3 $pidacore;
exit;
else
MAX_ACORE;
fi;
}
MAX_MEDIA()
{
pidmedia=`pidof android.process.media`;
if [ $pidmedia ];
then
/system/xbin/echo "-17" > /proc/$pidmedia/oom_adj;
renice -20 $pidmedia;
exit;
else
MAX_MEDIA;
fi;
}
MAX_UI()
{
pidui=`pidof com.android.systemui`;
if [ $pidui ];
then
/system/xbin/echo "-17" > /proc/$pidui/oom_adj;
renice -20 $pidui;
exit;
else
MAX_UI;
fi;
}
Thanks!
user.feature.lgdrm=false disable DRM Service, so you can not use the default phone ringtones and notifications but if you are planning to use your custom files without DRM then there are no problems.
Regards.
How can I overclock GPU by 400MHz?I have heart about that the SGX540 may actually clocked at 400MHZ。http://forum.xda-developers.com/showthread.php?p=15107363
How to improve 3D performance ?How to get more than 5000 in antutu?
Does the below sript have any proplem?
#!/system/bin/sh
###
##
#
busybox cp /system/.nomedia /d/
busybox cp /system/.nomedia /data/
busybox cp /system/.nomedia /dbdata/
busybox cp /system/.nomedia /dev/
busybox cp /system/.nomedia /etc/
busybox cp /system/.nomedia /lib/
busybox cp /system/.nomedia /mnt/
busybox cp /system/.nomedia /sys/
insmod /lib/modules/deadline-iosched.ko
mmc=`ls -d /sys/block/mmc*`; stl=`ls -d /sys/block/stl*`
for a in $mmc $stl; do
echo deadline > $a/queue/scheduler
echo 8 > $a/queue/iosched/fifo_batch
echo 400 > $a/queue/iosched/read_expire
echo 4 > $a/queue/iosched/writes_starved
echo 0 > $a/queue/iostats
echo 4 > $a/queue/nr_requests
echo 0 > $i/queue/rotational
done
busybox sysctl -w kernel.sched_latency_ns="600000"
busybox sysctl -w kernel.sched_wakeup_granularity_ns="3000000"
#busybox sysctl -w kernel.sched_min_granularity_ns="1500000"
#echo "2048" > /proc/sys/kernel/msgmni;
#echo "64000" > /proc/sys/kernel/msgmax;
#echo "10" > /proc/sys/fs/lease-break-time;
#echo "NO_NORMALIZED_SLEEPER" > /sys/kernel/debug/sched_features
#echo "NO_FAIR_SLEEPERS" > /sys/kernel/debug/sched_features
#echo "NO_GENTLE_FAIR_SLEEPERS" > /sys/kernel/debug/sched_features
#echo "2000" > /proc/sys/vm/dirty_writeback_centisecs
#echo "1000" > /proc/sys/vm/dirty_expire_centisecs
echo "90" > /proc/sys/vm/dirty_ratio
echo "60" > /proc/sys/vm/dirty_background_ratio
echo "1" > /proc/sys/vm/vfs_cache_pressure
echo "0" > /proc/sys/vm/swappiness
echo 80 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo "0" > /proc/sys/net/ipv4/tcp_timestamps;
echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse;
echo "1" > /proc/sys/net/ipv4/tcp_sack;
echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle;
echo "1" > /proc/sys/net/ipv4/tcp_window_scaling;
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;
echo "404480" > /proc/sys/net/core/wmem_max;
echo "404480" > /proc/sys/net/core/rmem_max;
echo "256960" > /proc/sys/net/core/rmem_default;
echo "256960" > /proc/sys/net/core/wmem_default;
echo "4096,16384,404480" > /proc/sys/net/ipv4/tcp_wmem;
setprop debug.sf.hw 1; # HARDWARE RENDERING (GPU)
setprop video.accelerate.hw 1;
setprop debug.performance.tuning 1;
if [ -e /sys/module/pm_hotplug/parameters/loadl ]; then
echo 40 > /sys/module/pm_hotplug/parameters/loadl;
echo 90 > /sys/module/pm_hotplug/parameters/loadh;
echo 50 > /sys/module/pm_hotplug/parameters/loadl_scroff;
echo 100 > /sys/module/pm_hotplug/parameters/loadh_scroff;
echo 200 > /sys/module/pm_hotplug/parameters/rate;
echo 800 > /sys/module/pm_hotplug/parameters/rate_cpuon;
echo 800 > /sys/module/pm_hotplug/parameters/rate_scroff;
echo 500000 > /sys/module/pm_hotplug/parameters/freq_cpu1on;
fi;
if [ -e /sys/devices/system/cpu/cpu0/cpufreq/smooth_target ]; then
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/smooth_target;
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/smooth_offset;
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/smooth_step;
fi;
if [ -e /sys/devices/system/cpu/sched_mc_power_savings ]; then
echo 1 > /sys/devices/system/cpu/sched_mc_power_savings;
fi;
if [ -e /sys/module/cpuidle/parameters/enable_mask ]; then
echo 3 > /sys/module/cpuidle/parameters/enable_mask;
fi;
if [ -e /sys/class/misc/brightness_curve/min_bl ]; then
echo 20 > /sys/class/misc/brightness_curve/min_bl;
echo 1 > /sys/class/misc/brightness_curve/min_gamma;
echo 24 > /sys/class/misc/brightness_curve/max_gamma;
fi;
#echo 4 > /sys/devices/system/cpu/cpu0/cpufreq/deepsleep_cpulevel;
#echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/deepsleep_buslevel;
echo "1300000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo "0 0 0 0 0 0 0 " > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table
echo "1 1 1 1 1 1 " > /sys/devices/system/cpu/cpu0/cpufreq/states_enabled_table
echo "300 400 300 400 300 400 300 300 267 267 200 100 " > /sys/devices/system/cpu/cpu0/cpufreq/gpu_clock_table
echo 85 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo "500" > /proc/sys/vm/dirty_expire_centisecs
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs
# CFS options moved elsewhere!
#if [ -e /proc/sys/kernel/rr_interval ];
#then
# BFS;
# echo 6 > /proc/sys/kernel/rr_interval;
# echo 75 > /proc/sys/kernel/iso_cpu;
#else
# CFS
# following 2 settings are to be handled with care - could lead to bootlooping phone or other issues if too low !
#echo 100000 > /proc/sys/kernel/sched_latency_ns; # 1000000 # 18000000 # 1000000 # 100000 ## new
#echo 500000 > /proc/sys/kernel/sched_wakeup_granularity_ns ; # 500000 # 3000000 # 25000 # 0 (?)
#echo 750000 > /proc/sys/kernel/sched_min_granularity_ns; # 1000000 # 1500000 # 100000 # 1000000 ## 750000 (upstream)
#echo 200000 > /proc/sys/kernel/sched_min_granularity_ns; # 1000000 # 1500000 # 100000 # 1000000 ## 750000 (upstream)
#echo 400000 > /proc/sys/kernel/sched_latency_ns; # 1000000 # 18000000 # 1000000 # 100000 ## new
#echo 100000 > /proc/sys/kernel/sched_wakeup_granularity_ns ; # 500000 # 3000000 # 25000 # 0 (?)
#echo -1 > /proc/sys/kernel/sched_rt_runtime_us;
#echo 100000 > /proc/sys/kernel/sched_rt_period_us;
#echo 95000 > /proc/sys/kernel/sched_rt_runtime_us; # default: 950000; very small values in sched_rt_runtime_us can result in an unstable system when the runtime is so small
# the system has difficulty making forward progress (the migration thread and kstopmachine both are real-time processes)
#fi;
insmod /lib/modules/deadline-iosched.ko
mmc=`ls -d /sys/block/mmc*`; stl=`ls -d /sys/block/stl*`; bml=`ls -d /sys/block/bml*`; tsfr=`ls -d /sys/block/tfsr*`;
for a in $mmc $stl $bml $tsfr; do
echo deadline > $a/queue/scheduler
echo 8 > $a/queue/iosched/fifo_batch
echo 400 > $a/queue/iosched/read_expire
echo 4 > $a/queue/iosched/writes_starved
echo 0 > $a/queue/iostats
echo 4 > $a/queue/nr_requests
echo 0 > $i/queue/rotational
done
#echo "2000" > /proc/sys/vm/dirty_writeback_centisecs
#echo "1000" > /proc/sys/vm/dirty_expire_centisecs
echo "90" > /proc/sys/vm/dirty_ratio
echo "55" > /proc/sys/vm/dirty_background_ratio
echo "1" > /proc/sys/vm/vfs_cache_pressure
echo "0" > /proc/sys/vm/swappiness
echo "0" > /proc/sys/net/ipv4/tcp_timestamps;
echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse;
echo "1" > /proc/sys/net/ipv4/tcp_sack;
echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle;
echo "1" > /proc/sys/net/ipv4/tcp_window_scaling;
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;
echo "404480" > /proc/sys/net/core/wmem_max;
echo "404480" > /proc/sys/net/core/rmem_max;
echo "256960" > /proc/sys/net/core/rmem_default;
echo "256960" > /proc/sys/net/core/wmem_default;
echo "4096,16384,404480" > /proc/sys/net/ipv4/tcp_wmem;
echo 1 > /sys/class/misc/backlightnotification/enabled
sync
echo 3 > /proc/sys/vm/drop_caches
setprop ro.ril.disable.power.collapse = 1
#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;
#}
echo 1 > /sys/class/misc/backlightnotification/enabled
sleep 10
sync
echo 3 > /proc/sys/vm/drop_caches
Sorry for my weak English。
In order to improve the sound ,I write a script.
as below,the script doesn't work.
Can you tell me,what's wrong in the script?
sorry from my bad English!
#!/system/bin/sh
# by liweichu
echo 1 > /sys/class/misc/voodoo_sound_control/enable
echo 1 > /sys/class/misc/voodoo_sound/headphone_eq
echo -10000 > /sys/class/misc/voodoo_sound/digital_gain
echo 50 > /sys/class/misc/voodoo_sound/headphone_amplifier_level
echo 1 > /sys/class/misc/voodoo_sound/fll_tuning
echo 1 > /sys/class/misc/voodoo_sound/dac_osr128
echo 1 > /sys/class/misc/voodoo_sound/adc_osr128
echo 1 > /sys/class/misc/voodoo_sound/dac_direct
echo 0 > /sys/class/misc/voodoo_sound/mono_downmix
echo 1 > /sys/class/misc/voodoo_sound/fm_radio_headset_normalize_gain
echo 1 > /sys/class/misc/voodoo_sound/fm_radio_headset_restore_bass
echo 1 > /sys/class/misc/voodoo_sound/fm_radio_headset_restore_highs
echo 10 > /sys/class/misc/voodoo_sound/headphone_eq_b1_gain
echo -2 > /sys/class/misc/voodoo_sound/headphone_eq_b2_gain
echo -9 > /sys/class/misc/voodoo_sound/headphone_eq_b3_gain
echo 4 > /sys/class/misc/voodoo_sound/headphone_eq_b4_gain
echo 8 > /sys/class/misc/voodoo_sound/headphone_eq_b5_gain
echo 1 > /sys/class/misc/voodoo_sound/recording_preset
These are different usb modes you can force from a adb shell (needs root)
This is just a fyi for information.
echo 1 > /sys/devices/virtual/android_usb/android0/f_diag/on
echo 1 > /sys/devices/virtual/android_usb/android0/f_diag_mdm/on
echo 1 > /sys/devices/virtual/android_usb/android0/f_rndis/on
echo 1 > /sys/devices/virtual/android_usb/android0/f_modem/on
echo 1 > /sys/devices/virtual/android_usb/android0/f_serial/on
echo 1 > /sys/devices/virtual/android_usb/android0/f_acm/on
echo 1 > /sys/devices/virtual/android_usb/android0/f_ccid/on
echo 1 > /sys/devices/virtual/android_usb/android0/f_accessory/on
echo 1 > /sys/devices/virtual/android_usb/android0/f_adb/on
echo 1 > /sys/devices/virtual/android_usb/android0/f_audio_source/on
echo 1 > /sys/devices/virtual/android_usb/android0/f_cdc_ethernet/on
echo 1 > /sys/devices/virtual/android_usb/android0/f_cdc_network/on
echo 1 > /sys/devices/virtual/android_usb/android0/f_mass_storage/on
echo 1 > /sys/devices/virtual/android_usb/android0/f_mtp/on
echo 1 > /sys/devices/virtual/android_usb/android0/f_projector/on
echo 1 > /sys/devices/virtual/android_usb/android0/f_projector2/on
echo 1 > /sys/devices/virtual/android_usb/android0/f_ptp/on
echo 1 > /sys/devices/virtual/android_usb/android0/f_rmnet/on
echo 1 > /sys/devices/virtual/android_usb/android0/f_rmnet_sdio/on
echo 1 > /sys/devices/virtual/android_usb/android0/f_rmnet_smd/on
echo 1 > /sys/devices/virtual/android_usb/android0/f_rmnet_smd_sdio/on
echo 1 > /sys/devices/virtual/android_usb/android0/f_rmnet/on
cdc_ether
Hi I am trying to connect a cdc_ether device into the LG Nexus5 usb port. I have cross compiled kernel for 3.4.0 hammerhead for this devices and enabled the cdc_ether module on it. But when I looked at the /sys/devices/virtual/android_usb/android0/f_cdc_ethernet/on, the f_cdc_ethernet directory doesnt exist. Does that mean the kernel was compiled wrong?
Finally got a new battery after over a year of not using my Droid 4.
Flashed latest CM13 nightly, 1.4ghz OC. Everything seems slow.
My 512mb ram single core $19 cheapo runs smoother.
Anything I do has a half-second or so delay, clean install with nothing running in the background.
Ideally I would just go back to some minimal 2.3.7 ROM, but compatiblity for new programs is getting iffy.
So, as of 2016, what has the smoothest ROM to do date been?
azkay said:
Finally got a new battery after over a year of not using my Droid 4.
Flashed latest CM13 nightly, 1.4ghz OC. Everything seems slow.
My 512mb ram single core $19 cheapo runs smoother.
Anything I do has a half-second or so delay, clean install with nothing running in the background.
Ideally I would just go back to some minimal 2.3.7 ROM, but compatiblity for new programs is getting iffy.
So, as of 2016, what has the smoothest ROM to do date been?
Click to expand...
Click to collapse
I'm running very, very debloated, overclocked stock JB 4.1.2 with Greenify and ram manager and it works pretty well. Even most of new games and emulators rund good.
Cyanogenmod 11 is quite good. One thing I noticed is that the virtual ROM slots are extremely slow, due to the loopback devices.
One way to go is to install the ROM to the virtual ROM slots to test if they are working correctly and then install it into stock slot for real use.
Up, same question here
I use cm11 or cm12 (i find cm13 extremely slow) But with the following tweaks made from my daily experience feel free to try it
Add those lines on boot
swapoff /dev/block/zram0
echo 1 > /sys/block/zram0/reset
#
# setting zram size to 140 mb
echo 396286400 > /sys/block/zram0/disksize
#
# making zram swapable
mkswap /dev/block/zram0
#
# starting swap on zram
swapon /dev/block/zram0
sysctl -w vm.overcommit_ratio=2
sysctl -w vm.swappiness=100
sysctl -w vm.vfs_cache_pressure=70
swapoff /dev/block/zram0
swapon /dev/block/zram0
echo "0" > /sys/kernel/mm/ksm/run
chmod 755 /sys/kernel/dyn_fsync/Dyn_fsync_active
echo "1" > /sys/kernel/dyn_fsync/Dyn_fsync_active
#----------------------------------I/O------------------------------------
A=`ls -d /sys/block/mmcblk1` ;
B=`ls -d /sys/block/mmcblk0` ;
C=`ls -d /sys/block/mmcblk0/mmcblk0boot0` ;
D=`ls -d /sys/block/mmcblk0/mmcblk0boot1` ;
E=`ls -d /sys/block/mmcblk1/mmcblk0boot0` ;
F=`ls -d /sys/block/mmcblk1/mmcblk0boot1` ;
for i in $A $B $C $D $E $F;
do
chmod 755 $i/queue/scheduler
echo "sioplus" > $i/queue/scheduler
echo "16" > $i/queue/iosched/fifo_batch;
echo "1048576" > $i/queue/iosched/back_seek_max;
echo "128" > $i/queue/nr_requests;
echo "1" > $i/queue/add_random;
echo "1" > $i/queue/iosched/back_seek_penalty;
echo "1" > $i/queue/rq_affinity;
echo "3" > $i/queue/iosched/writes_starved;
echo "16" > $i/queue/iosched/quantum;
echo "0" > $i/queue/rotational
echo "1" > $i/queue/iostats
echo "500" > $i/queue/iosched/read_expire;
echo "3000" > $i/queue/iosched/write_expire;
#---------------------------ReadAhead------------------------------
echo "512" > /sys/devices/virtual/bdi/179:24/read_ahead_kb #SD CARD
done
G=`ls -d /sys/class/bdi/7:0` ;
H=`ls -d /sys/class/bdi/7:1` ;
I=`ls -d /sys/class/bdi/7:2` ;
J=`ls -d /sys/class/bdi/7:3` ;
L=`ls -d /sys/class/bdi/7:4` ;
M=`ls -d /sys/class/bdi/default` ;
N=`ls -d /sys/class/bdi/7:5` ;
O=`ls -d /sys/class/bdi/7:6` ;
P=`ls -d /sys/class/bdi/7:7` ;
for i in $G $H $I $J $L $M $N $O $P;
do
chmod 755 $i/read_ahead_kb
echo "512" > $i/read_ahead_kb
echo "512" > /sys/class/bdi/default/read_ahead_kb
done
echo "512" > /sys/class/bdi/253:0/read_ahead_kb
#----------------------------------I/O--FOR SD AND INTERNAL----------------------------------
AA=`ls -d /sys/block/mmcblk1` ;
BB=`ls -d /sys/block/mmcblk0` ;
for i in $AA $BB;
do
chmod 755 $i/queue/scheduler
echo "sioplus" > $i/queue/scheduler
echo "0" > $i/queue/rotational
echo "16" > $i/queue/iosched/quantum;
echo "1048576" > $i/queue/iosched/back_seek_max;
echo "1" > $i/queue/rq_affinity;
echo "1" > $i/queue/iosched/back_seek_penalty;
echo "256" > $i/queue/nr_requests;
echo "1" > $i/queue/add_random;
echo "16" > $i/queue/iosched/fifo_batch;
echo "3" > $i/queue/iosched/writes_starved;
#echo "1" > $i/queue/iosched/quantum;
echo "1" > $i/queue/iostats
echo "500" > $i/queue/iosched/read_expire;
echo "3000" > $i/queue/iosched/write_expire;
done
sysctl -w kernel.panic_on_oops=0
#sysctl -w vm.min_free_kbytes=3774
sysctl -w vm.vfs_cache_pressure=70
sysctl -w vm.swappiness=100
sysctl -w vm.drop_caches=0
sysctl -w vm.min_free_kbytes=3774
sysctl -w vm.page-cluster=3
#setsd speeds
chmod 666 /sys/block/mmcblk0/queue/read_ahead_kb
echo "512" > /sys/block/mmcblk0/queue/read_ahead_kb
chmod 666 /sys/block/mmcblk1/queue/read_ahead_kb
echo "512" > /sys/block/mmcblk1/queue/read_ahead_kb
chmod 666 /sys/devices/virtual/bdi/179:0/read_ahead_kb
echo "512" > /sys/devices/virtual/bdi/179:0/read_ahead_kb
######sd card
chmod 666 /sys/devices/virtual/bdi/179:24/read_ahead_kb
echo "512" > /sys/devices/virtual/bdi/179:24/read_ahead_kb
chmod 666 /sys/devices/virtual/bdi/179:16/read_ahead_kb
echo "512" > /sys/devices/virtual/bdi/179:16/read_ahead_kb
chmod 666 /sys/devices/virtual/bdi/179:8/read_ahead_kb
echo "512" > /sys/devices/virtual/bdi/179:8/read_ahead_kb
chmod 666 /sys/devices/virtual/bdi/179:32/read_ahead_kb
echo "512" > /sys/devices/virtual/bdi/179:32/read_ahead_kb
chmod 666 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
chmod 666 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo "1300000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chmod 666 /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo "1200000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
chmod 666 /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo "interactive" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
chmod 666 /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
echo "1300000" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
chmod 666 /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
echo "1200000" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
echo 2 > /sys/devices/system/cpu/cpufreq/interactive/boost
echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
echo 70 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo 300000 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
echo 15000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo 60 > /sys/devices/system/cpu/cpufreq/interactive/target_loads
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
echo 30000 > /sys/devices/system/cpu/cpufreq/interactive/timer_slack
chmod 666 /sys/module/lowmemorykiller/parameters/minfree
echo '7936,16384,37120,57088,58880,65536' > /sys/module/lowmemorykiller/parameters/minfree
giannhs_n said:
I use cm11 or cm12 (i find cm13 extremely slow) But with the following tweaks made from my daily experience feel free to try it
Add those lines on boot
Click to expand...
Click to collapse
Thank you man, this script made my droid 4 a whole lot more responsive and it does not reboot every few hours anymore.
Quite a few commands in that script don't work, probably due to different paths (sio plus as io scheduler and stock rom boot slot), but those that work, really seem to help a lot.
Oh and you should update the comment in that script about the zram size.
Milp said:
Thank you man, this script made my droid 4 a whole lot more responsive and it does not reboot every few hours anymore.
Quite a few commands in that script don't work, probably due to different paths (sio plus as io scheduler and stock rom boot slot), but those that work, really seem to help a lot.
Oh and you should update the comment in that script about the zram size.
Click to expand...
Click to collapse
Was testing on different Kernels that's why the paths are wrong.. Please replace the sio plus with cfq or bfq (i forgot to change that)
I am glad that those tweaks help you
Regards john
What about this one? Mentor's ROM http://forum.xda-developers.com/showthread.php?t=2122709
That's what I found on my used Droid 4... should I give it a try?
giannhs_n said:
Was testing on different Kernels that's why the paths are wrong.. Please replace the sio plus with cfq or bfq (i forgot to change that)
I am glad that those tweaks help you
Regards john
Click to expand...
Click to collapse
why replace sio plus? I used bfq before, but when i googled for sio plus i only found people saying that sio plus was the best of them all.
Milp said:
why replace sio plus? I used bfq before, but when i googled for sio plus i only found people saying that sio plus was the best of them all.
Click to expand...
Click to collapse
If your kernel support sio plus, of course use it.. else cfq or bfq is a good alternative
giannhs_n said:
I use cm11 or cm12 (i find cm13 extremely slow) But with the following tweaks made from my daily experience feel free to try it
Add those lines on boot
swapoff /dev/block/zram0
echo 1 > /sys/block/zram0/reset
#
# setting zram size to 140 mb
echo 396286400 > /sys/block/zram0/disksize
#
# making zram swapable
mkswap /dev/block/zram0
#
# starting swap on zram
swapon /dev/block/zram0
sysctl -w vm.overcommit_ratio=2
sysctl -w vm.swappiness=100
sysctl -w vm.vfs_cache_pressure=70
swapoff /dev/block/zram0
swapon /dev/block/zram0
echo "0" > /sys/kernel/mm/ksm/run
chmod 755 /sys/kernel/dyn_fsync/Dyn_fsync_active
echo "1" > /sys/kernel/dyn_fsync/Dyn_fsync_active
#----------------------------------I/O------------------------------------
A=`ls -d /sys/block/mmcblk1` ;
B=`ls -d /sys/block/mmcblk0` ;
C=`ls -d /sys/block/mmcblk0/mmcblk0boot0` ;
D=`ls -d /sys/block/mmcblk0/mmcblk0boot1` ;
E=`ls -d /sys/block/mmcblk1/mmcblk0boot0` ;
F=`ls -d /sys/block/mmcblk1/mmcblk0boot1` ;
for i in $A $B $C $D $E $F;
do
chmod 755 $i/queue/scheduler
echo "sioplus" > $i/queue/scheduler
echo "16" > $i/queue/iosched/fifo_batch;
echo "1048576" > $i/queue/iosched/back_seek_max;
echo "128" > $i/queue/nr_requests;
echo "1" > $i/queue/add_random;
echo "1" > $i/queue/iosched/back_seek_penalty;
echo "1" > $i/queue/rq_affinity;
echo "3" > $i/queue/iosched/writes_starved;
echo "16" > $i/queue/iosched/quantum;
echo "0" > $i/queue/rotational
echo "1" > $i/queue/iostats
echo "500" > $i/queue/iosched/read_expire;
echo "3000" > $i/queue/iosched/write_expire;
#---------------------------ReadAhead------------------------------
echo "512" > /sys/devices/virtual/bdi/179:24/read_ahead_kb #SD CARD
done
G=`ls -d /sys/class/bdi/7:0` ;
H=`ls -d /sys/class/bdi/7:1` ;
I=`ls -d /sys/class/bdi/7:2` ;
J=`ls -d /sys/class/bdi/7:3` ;
L=`ls -d /sys/class/bdi/7:4` ;
M=`ls -d /sys/class/bdi/default` ;
N=`ls -d /sys/class/bdi/7:5` ;
O=`ls -d /sys/class/bdi/7:6` ;
P=`ls -d /sys/class/bdi/7:7` ;
for i in $G $H $I $J $L $M $N $O $P;
do
chmod 755 $i/read_ahead_kb
echo "512" > $i/read_ahead_kb
echo "512" > /sys/class/bdi/default/read_ahead_kb
done
echo "512" > /sys/class/bdi/253:0/read_ahead_kb
#----------------------------------I/O--FOR SD AND INTERNAL----------------------------------
AA=`ls -d /sys/block/mmcblk1` ;
BB=`ls -d /sys/block/mmcblk0` ;
for i in $AA $BB;
do
chmod 755 $i/queue/scheduler
echo "sioplus" > $i/queue/scheduler
echo "0" > $i/queue/rotational
echo "16" > $i/queue/iosched/quantum;
echo "1048576" > $i/queue/iosched/back_seek_max;
echo "1" > $i/queue/rq_affinity;
echo "1" > $i/queue/iosched/back_seek_penalty;
echo "256" > $i/queue/nr_requests;
echo "1" > $i/queue/add_random;
echo "16" > $i/queue/iosched/fifo_batch;
echo "3" > $i/queue/iosched/writes_starved;
#echo "1" > $i/queue/iosched/quantum;
echo "1" > $i/queue/iostats
echo "500" > $i/queue/iosched/read_expire;
echo "3000" > $i/queue/iosched/write_expire;
done
sysctl -w kernel.panic_on_oops=0
#sysctl -w vm.min_free_kbytes=3774
sysctl -w vm.vfs_cache_pressure=70
sysctl -w vm.swappiness=100
sysctl -w vm.drop_caches=0
sysctl -w vm.min_free_kbytes=3774
sysctl -w vm.page-cluster=3
#setsd speeds
chmod 666 /sys/block/mmcblk0/queue/read_ahead_kb
echo "512" > /sys/block/mmcblk0/queue/read_ahead_kb
chmod 666 /sys/block/mmcblk1/queue/read_ahead_kb
echo "512" > /sys/block/mmcblk1/queue/read_ahead_kb
chmod 666 /sys/devices/virtual/bdi/179:0/read_ahead_kb
echo "512" > /sys/devices/virtual/bdi/179:0/read_ahead_kb
######sd card
chmod 666 /sys/devices/virtual/bdi/179:24/read_ahead_kb
echo "512" > /sys/devices/virtual/bdi/179:24/read_ahead_kb
chmod 666 /sys/devices/virtual/bdi/179:16/read_ahead_kb
echo "512" > /sys/devices/virtual/bdi/179:16/read_ahead_kb
chmod 666 /sys/devices/virtual/bdi/179:8/read_ahead_kb
echo "512" > /sys/devices/virtual/bdi/179:8/read_ahead_kb
chmod 666 /sys/devices/virtual/bdi/179:32/read_ahead_kb
echo "512" > /sys/devices/virtual/bdi/179:32/read_ahead_kb
chmod 666 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
chmod 666 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo "1300000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chmod 666 /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo "1200000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
chmod 666 /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo "interactive" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
chmod 666 /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
echo "1300000" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
chmod 666 /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
echo "1200000" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
echo 2 > /sys/devices/system/cpu/cpufreq/interactive/boost
echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
echo 70 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo 300000 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
echo 15000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo 60 > /sys/devices/system/cpu/cpufreq/interactive/target_loads
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
echo 30000 > /sys/devices/system/cpu/cpufreq/interactive/timer_slack
chmod 666 /sys/module/lowmemorykiller/parameters/minfree
echo '7936,16384,37120,57088,58880,65536' > /sys/module/lowmemorykiller/parameters/minfree
Click to expand...
Click to collapse
What am I supposed to do with these lines? And can somebody please explain what they are doing specifically?
I was trying to find a way to enable zram to cope with the small amount of memory. swap ram is an alternative, but i heard zram is faster and not stressing the storage like swap ram would.