From 73becf745274ab5fe99615b1dbed67022102d08e Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Wed, 17 May 2017 15:27:32 -0700 Subject: [PATCH] sm6150-common: Tune zram performance -Switch to LZ4 for better overall performance -Set max_comp_streams to num of cores since upstream also moves this to percpu. -Set page-cluster to 0 as the incremental cost of reading 1 page at a time is negligible for zram Bug: 38249616 Test: boot and run zram-perf showing better performance Change-Id: I0b92b246d773db85aa03d033b2cecee54347cbd1 --- rootdir/etc/fstab.zram | 2 +- rootdir/etc/init.target.rc | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/rootdir/etc/fstab.zram b/rootdir/etc/fstab.zram index c33cdbb..faf8e03 100644 --- a/rootdir/etc/fstab.zram +++ b/rootdir/etc/fstab.zram @@ -1,4 +1,4 @@ # Android fstab file. # -/dev/block/zram0 none swap defaults zramsize=1073741824 +/dev/block/zram0 none swap defaults zramsize=1073741824,max_comp_streams=8 diff --git a/rootdir/etc/init.target.rc b/rootdir/etc/init.target.rc index 58c608f..464867f 100644 --- a/rootdir/etc/init.target.rc +++ b/rootdir/etc/init.target.rc @@ -53,6 +53,10 @@ on init write /sys/block/sde/queue/read_ahead_kb 2048 write /sys/block/sde/queue/nr_requests 256 + # ZRAM setup + write /sys/block/zram0/comp_algorithm lz4 + write /proc/sys/vm/page-cluster 0 + on fs mount_all --early /vendor/etc/fstab.qcom