From 88f424e979e885650f3e7e5994f49cd9f47235c8 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Wed, 17 May 2017 15:27:32 -0700 Subject: [PATCH] wahoo: 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 --- fstab.hardware | 2 +- init.hardware.rc | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/fstab.hardware b/fstab.hardware index 027b7886..413d1fa3 100644 --- a/fstab.hardware +++ b/fstab.hardware @@ -7,4 +7,4 @@ /dev/block/platform/soc/1da4000.ufshc/by-name/misc /misc emmc defaults defaults /dev/block/platform/soc/1da4000.ufshc/by-name/modem /firmware vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait,slotselect /devices/soc/a800000.ssusb/a800000.dwc3* auto vfat defaults voldmanaged=usb:auto -/dev/block/zram0 none swap defaults zramsize=536870912 +/dev/block/zram0 none swap defaults zramsize=536870912,max_comp_streams=8 diff --git a/init.hardware.rc b/init.hardware.rc index c0330436..9239a4a8 100644 --- a/init.hardware.rc +++ b/init.hardware.rc @@ -143,6 +143,10 @@ on init # b/37682684 Enable suspend clock reporting write /sys/kernel/debug/clk/debug_suspend 1 + # ZRAM setup + write /sys/block/zram0/comp_algorithm lz4 + write /proc/sys/vm/page-cluster 0 + on fs wait /dev/block/platform/soc/${ro.boot.bootdevice} symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice