universal7580: enable ZRAM
authorDanny Wood <danwood76@gmail.com>
Tue, 3 Aug 2021 14:46:48 +0000 (15:46 +0100)
committerDanny Wood <danwood76@gmail.com>
Fri, 27 Aug 2021 14:00:30 +0000 (15:00 +0100)
* Also disable samsung sswap

Change-Id: I5152fa95a168a7e3e3ae3de18ca76f33fe7f9cfb

ramdisk/etc/fstab.samsungexynos7580
ramdisk/etc/init.samsungexynos7580.rc
sepolicy/file_contexts

index 685ac829412bba705baa4c5c29994c2e01c1d061..f0b0000c2073b2ced2e0d9d61f69dfc43ab6aac2 100644 (file)
@@ -19,3 +19,6 @@
 /devices/13560000.dwmmc2/mmc_host/mmc*                  auto        auto    defaults                                                                        voldmanaged=sdcard1:auto,encryptable=userdata
 /devices/13510000.usb/usb*                              auto        auto    defaults                                                                        voldmanaged=usb:auto
 /devices/13520000.usb/usb*                              auto        auto    defaults                                                                        voldmanaged=usb:auto
+
+# ZRAM
+/dev/block/zram0                                        none        swap    defaults                                                                        zramsize=75%,max_comp_streams=8
index 2d62c74f114d03c3152778abbcf0982881da2b5e..246e2dd4d493b19759761648737b37b59070a65c 100644 (file)
@@ -8,6 +8,10 @@ import init.target.rc
 on early-init
     mount debugfs /sys/kernel/debug /sys/kernel/debug mode=755
 
+    # ZRAM setup
+    write /sys/block/zram0/comp_algorithm lz4
+    write /proc/sys/vm/page-cluster 0
+
 on init
     # RIL <-> audioserver comm
     chmod 0644 /proc/cmdline
@@ -227,6 +231,10 @@ on fs
     mount_all /fstab.samsungexynos7580
     setprop ro.crypto.fuse_sdcard true
 
+    # Enable swap
+    swapon_all /fstab.samsungexynos7580
+    write /proc/sys/vm/swappiness 100
+
 # Permissions for ION
     chmod 0660 /sys/class/ion_cma/ion_video_ext/isolated
     chown system system /sys/class/ion_cma/ion_video_ext/isolated
@@ -809,9 +817,3 @@ on charger
     write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor powersave
     write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor powersave
     write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor powersave
-
-service sswap /vendor/bin/sswap -s -f 1024
-      class core
-      user root
-      group root
-      oneshot
index 339efd7fb15a0524a85f0b30a878bc0f17b6a49b..9626d8e6fbdf145eb18c31c7951d5091eb48314e 100644 (file)
@@ -26,6 +26,7 @@
 /dev/ttySAC[0-1]*            u:object_r:gps_device:s0
 
 /dev/block/vnswap0           u:object_r:sswap_device:s0
+/dev/block/zram0             u:object_r:swap_block_device:s0
 
 /dev/block/mmcblk0p[0-9]*    u:object_r:emmcblk_device:s0