summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Shields <keepcalm444@gmail.com>2016-03-18 23:03:14 +1100
committerSimon Shields <keepcalm444@gmail.com>2016-03-19 00:18:49 +1100
commit258dde57636ccaf8ec013915fe131aa7803e074a (patch)
tree77dfe17fd5c974a6b1a9cfa2b2397ee3c0d071aa
parent6eaec4905ca050b6eff728c40e81186b194a59d5 (diff)
downloaddevice_samsung_i9300-258dde57636ccaf8ec013915fe131aa7803e074a.zip
device_samsung_i9300-258dde57636ccaf8ec013915fe131aa7803e074a.tar.gz
device_samsung_i9300-258dde57636ccaf8ec013915fe131aa7803e074a.tar.bz2
i9300: more memory tweaks
some users are seeing OOMs. Enable KSM, bump up zram and be more aggressive about swapping. Some of these values are taken from "Android Memory Tuning": https://01.org/android-ia/user-guides/android-memory-tuning-android-5.0-and-5.1 Change-Id: Id950c473a5de29bb0e1e2f0a1d3602ddb982e663
-rw-r--r--rootdir/fstab.smdk4x122
-rw-r--r--rootdir/init.target.rc16
2 files changed, 17 insertions, 1 deletions
diff --git a/rootdir/fstab.smdk4x12 b/rootdir/fstab.smdk4x12
index 8c2e87d..ba27ca6 100644
--- a/rootdir/fstab.smdk4x12
+++ b/rootdir/fstab.smdk4x12
@@ -20,4 +20,4 @@
/dev/block/mmcblk0p7 /modem emmc defaults recoveryonly
# zram
-/dev/block/zram0 none swap defaults zramsize=268435456
+/dev/block/zram0 none swap defaults zramsize=419430400
diff --git a/rootdir/init.target.rc b/rootdir/init.target.rc
index d17fc69..5e4890f 100644
--- a/rootdir/init.target.rc
+++ b/rootdir/init.target.rc
@@ -34,6 +34,22 @@ on init
chown system system /sys/devices/system/cpu/cpufreq/pegasusq/max_cpu_lock
chown system system /sys/devices/system/cpu/cpufreq/pegasusq/sampling_rate
+on boot
+ # Flash storage isn't a good entropy source, and only causes
+ # locking overhead in the kernel. Turn it off.
+ write /sys/block/mmcblk0/queue/add_random 0
+ write /sys/block/mmcblk1/queue/add_random 0
+
+ # KSM
+ write /sys/kernel/mm/ksm/deferred_timer 1
+ write /sys/kernel/mm/ksm/pages_to_scan 100
+ write /sys/kernel/mm/ksm/sleep_millisecs 500
+ write /sys/kernel/mm/ksm/run 1
+
+ # Swapping 1 page at a time is ok
+ write /proc/sys/vm/page-cluster 0
+
+ write /proc/sys/vm/swappiness 100