16kb: Set compression algorithm based on the kernel page size

The zram compression algorithm will be set based on the
page size.

- 4kb kernels will use lz77eh
- 16kb kernels will use lzo-rle due Emerald Hill does not
  support 16kb page sizes.

Bug: 354960718
Test: # 4kb kernel
      zumapro:/ # getconf PAGE_SIZE
      4096
      zumapro:/ # cat /sys/block/zram0/comp_algorithm
      [lz77eh] zstd lz4 lzo-rle lzo

      # 16kb kernel
      zumapro:/ # getconf PAGE_SIZE
      16384
      zumapro:/ # cat /sys/block/zram0/comp_algorithm
      lz77eh zstd lz4 [lzo-rle] lzo
Flag: EXEMPT bugfix
Change-Id: I9630c6323860621a48ca9620fcf416372ccdf7f6
This commit is contained in:
Juan Yescas 2024-07-23 10:45:40 -07:00
parent 11ef97edd0
commit ecfc3d4541

View file

@ -81,7 +81,6 @@ on init
start vendor.keymaster-4-0
# ZRAM setup
write /sys/block/zram0/comp_algorithm lz77eh
write /proc/sys/vm/page-cluster 0
# Some user code relies on ro.boot.hardware.revision
@ -176,6 +175,14 @@ on init
# Enable CPU Idle histograms
write /sys/kernel/metrics/cpuidle_histogram/enable 1
# ZRAM setup: use EH in 4kb kernels.
on init && property:ro.boot.hardware.cpu.pagesize=4096
write /sys/block/zram0/comp_algorithm lz77eh
# ZRAM setup: do not use EH in 16kb kernels.
on init && property:ro.boot.hardware.cpu.pagesize=16384
write /sys/block/zram0/comp_algorithm lzo-rle
on post-fs
# Ensure device is ready and start storageproxyd
wait /dev/sg1