vm.dirty_writeback_centisecs=2500
vm.dirty_expire_centisecs=1000
vm.dirty_ratio=90
vm.panic_on_oom=0
vm.dirty_background_ratio=60
vm.page-cluster=3
vm.swappiness=0
vm.vfs_cache_pressure=25
vm.min_free_kbytes=4096
vm.min_free_order_shift=4
# Breaking the lease
echo "15" > /proc/sys/fs/lease-break-time
# File system Mounts (By DroidTh3ory?)
busybox mount -o remount,noatime,nodiratime,discard,noauto_da_alloc,nosuid,nodev,data=writeback,barrier=0 -t auto /
busybox mount -o remount,noatime,nodiratime,discard,noauto_da_alloc,nosuid,nodev,data=writeback,barrier=0 -t auto /dev
busybox mount -o remount,noatime,nodiratime,discard,noauto_da_alloc,nosuid,nodev,data=writeback,barrier=0 -t auto /proc
busybox mount -o remount,noatime,nodiratime,discard,noauto_da_alloc,nosuid,nodev,data=writeback,barrier=0 -t auto /sys
busybox mount -o remount,noatime,nodiratime,discard,noauto_da_alloc,nodev,data=writeback,barrier=0 -t auto /system
busybox mount -o remount,noatime,nodiratime,discard,noauto_da_alloc,nosuid,nodev,data=writeback,barrier=0 -t auto /data
busybox mount -o remount,noatime,nodiratime,discard,noauto_da_alloc,nosuid,nodev,data=writeback,barrier=0 -t auto /data/data
busybox mount -o remount,noatime,nodiratime,discard,noauto_da_alloc,nosuid,nodev,data=writeback,barrier=0 -t auto /cache
busybox mount -o remount,noatime,nodiratime,discard,noauto_da_alloc,nosuid,nodev,data=writeback,barrier=0 -t auto /acct
busybox mount -o remount,noatime,nodiratime,discard,noauto_da_alloc,nosuid,nodev,data=writeback,barrier=0 -t auto /dev/pts
busybox mount -o remount,noatime,nodiratime,discard,noauto_da_alloc,nosuid,nodev,data=writeback,barrier=0 -t auto /dev/cpuctl
busybox mount -o remount,noatime,nodiratime,discard,noauto_da_alloc,nosuid,nodev,data=writeback,barrier=0 -t auto /mnt/asec
busybox mount -o remount,noatime,nodiratime,discard,noauto_da_alloc,nosuid,nodev,data=writeback,barrier=0 -t auto /mnt/obb
busybox mount -o remount,noatime,nodiratime,discard,noauto_da_alloc,nosuid,nodev,data=writeback,barrier=0 -t auto /mnt/sdcard
# imoseyon file system speedups
busybox mount -o remount,noatime,barrier=0,nobh /system
busybox mount -o remount,noatime /data
busybox mount -o remount,noatime,barrier=0,nobh /cache
Everything I've learned in the last year about Linux and Android is thanks to xda, franco.Kernel and an itchy Googling finger. Gotta love tweaking. ;)
#!/system/bin/sh
output=/sdcard/output.txt;
location="/sys/block/mmcblk0/queue /proc/sys/vm /sys/module/lowmemorykiller/parameters";
for target in $location; do
echo $target/ >> $output;
for file in $(ls $target); do
echo `cat $target/$file` $file >> $output;
done;
echo -e "\n" >> $output;
done;
#!/system/bin/sh
# chmod -R 755 /system/etc/init.d
# 19-Mar-2013
echo 5 > /proc/sys/vm/dirty_background_ratio;
echo 200 > /proc/sys/vm/dirty_expire_centisecs;
echo 90 > /proc/sys/vm/dirty_ratio;
echo 500 > /proc/sys/vm/dirty_writeback_centisecs;
echo 2048 > /proc/sys/vm/min_free_kbytes;
echo 2 > /proc/sys/vm/min_free_order_shift;
echo 30 > /proc/sys/vm/swappiness;
echo 85 > /proc/sys/vm/vfs_cache_pressure;
For krushys settings:
http://db.tt/uXgeha9Q
# fs tweaks
echo 15 > /proc/sys/fs/lease-break-time;
Here's what I know about it:
This file specifies the grace period (in seconds) that the kernel grants to a process holding a file lease after it has sent a signal to that process notifying it that another process is waiting to open the file. If the lease holder does not remove or downgrade the lease within this grace period, the kernel forcibly breaks the lease. Defaults to 45.
From Googling it I'm seeing a lot of people using 10 on various devices, Zach's scripts from Sorcery had 15.
Never been a big fan of file locks, knowing blt is in seconds now, I'm also leaning toward 10.
build.prop should be:
dalvik.vm.heapgrowthlimit=64m
dalvik.vm.heapsize=384m
(like Nexus 7)
instead of:
dalvik.vm.heapgrowthlimit=96m
dalvik.vm.heapsize=256m
Which apparently brings back the snappines of 4.1. Not tried it yet though.
Going to try this in 925vm shortly.
Edit: Ah damn, there's no corresponding sysfs for those.. Looking into sysctl.
Edit 2: Nothing there either. So our only hope to not mod the system is with /data/local.prop, it's kinda finicky about what it accepts and how it's written and it doesn't always match the way it is in build.prop.
setprop dalvik.vm.heapgrowthlimit 64m
setprop dalvik.vm.heapsize 384m
I'll extract the build.prop from all the old Factory images to double check that guy's findings.
Maybe Google takes issue with .sh files being uploaded? I've renamed them to .txt this time.. Anyway, here's what we ended up with. Attached.
I left nobh in the fstab even though it doesn't appear to get set. Maybe on Android it's more of an ext3 (different filesystem type) setting than for ext4 which we use. I also left the nodiratime in the command in fkbootscript.sh in case it randomly starts working sometime. Neither are hurting or anything.
1) Set noatime and nodiratime to /, /sys, and /proc (the sysfs) for a possible speed up.
2) Same as above but to /storage/emulated/0 etc (sdcard).
Edit: Attached the init.d script. Adding the if-statement broke it adding nodiratime to userdata because, like I said, it's touchy and defies logic. Anyway that's not important right now. Hopefully once we're done testing the sysfs/sdcard stuff I can remove the if-statement and it'll magically start working again. Note if you aren't using boot-r376-fstab, none of the userdata/cache/system mounts in 875mnt will set entirely correctly either (eg. missing nodev and nodiratime for system, but discard and barrier=0 set fine). It makes no sense.
Where is barrier=0 Francisco? Did you set it in a .rc file or something? It doesn't show up and it's not in the fstab.. I was trying to figure out the rc mount syntax to add nodiratime but couldn't get it to do anything.. But that's another story.
You do have writeback of course, but I think you misunderstood me, I was more discussing the incompatibility of writeback and discard on userdata in the fstab that caused those bootloops you saw last time. Those only happen when both are in the fstab, and busybox can't set writeback, so we leave writeback where you had it in the fstab and set discard in fkbootscript.sh instead; problem solved! :D
Like I was saying I discovered, barrier=0 also doesn't get along with writeback with userdata in the fstab, so that's why I added it in the .sh as well.
Like I said barrier=0 is in every set of tweaks I've seen and a lot of kernels fstabs and ROMs that use init.d scripts. So it must be reasonably safe. For a popular example, it's in the AK fstab and they don't have corruption more than we do. From the documentation, even using writeback alone carries higher risk of data corruption but we've also been doing that for ages. I'd put them on par. Fsync off is a bit different, it's literally telling the machine you don't care about writing out the data it's got in memory in a timely fashion, you just want speed, so keep going. Fsync on blocks further calls until the current operation has written out.
I think it's the partition tweaks, but the sd tweaks may also contribute.
Running the script with both variables off speeds things up a lot, so that's why I think it's the partition tweaks, since they're outside the variable-controlled if/thens.
Turning the sysfs variable on then doesn't seem to change much (but certainly no detriment), and then turning the sd variable on - with either sysfs on or off - seems to take it up yet another notch.
Nothing objective, just feel-based.
Maybe we should benchmark the various combinations...
Paul, Where you might of found lag at transitions it might be because you have turned up the animation / transitions speeds in dev options? Anyway I'm really pleased with the effect on the pure feel of these I really reckon it would go down great in with the public builds.
BTW, I really wasn't meaning to complain about it... I like the speed increase. I really just wanted to point out that it may cause some people to say it feels less smooth.