We do not have AdrenoTest.apk or SWE_Browser.apk so it does not make
sense to try to install them.
Change-Id: I0615e2e50526f960d5a6c221798ab5ebd1162d7b
5.4 kernel defaults to lzo-rle for zram. lzo-rle added run-length
encoding for lzo, which is beneficial to the use case of zram that
often has long runs of zero bytes. However, according to my testing
results, lzo-rle still has lower decompression throughput and higher
access latency compared to lz4. lzo-rle beats lz4 in compression
ratio, but most Xiaomi SM8350 devices have either 8GB or 12GB of RAM
where memory pressure hardly happens. Therefore, lz4's higher throughput
and lower latency is more preferable.
Now that I added LZ4_FAST_DEC_LOOP to the kernel lz4 module from
upstream lz4 1.9.x release, the decompression speed has increased
by another 10%, which leads further ahead lzo-rle.
Test setup:
- Disable swap on zram if it is enabled
$ swapoff /dev/block/zram0
- If you want to change the comp_algorithm after zram has been
initialized, reset zram first.
$ echo 1 > /sys/block/zram0/reset
- Set the comp_algorithm. For example, for lz4
$ echo lz4 > /sys/block/zram0/comp_algorithm
- Set up zram size
$ echo 4294967296 > /sys/block/zram0/disksize
- Make the swap
$ mkswap /dev/block/zram0
- Pre-fill zram with 1GB of real-word zram data dumped previously under
memory pressure. For example,
$ dd if=/sdcard/zram.test of=/dev/block/zram0 bs=1m count=1000
Random 4k read:
$ fio --readonly --name=randread --direct=1 --rw=randread --ioengine=psync \
--randrepeat=0 --numjobs=4 --iodepth=1 --group_reporting=1 \
--filename=/dev/block/zram0 --bs=4K --size=1000M
lzo-rle: read: IOPS=1547k, BW=6042MiB/s (6336MB/s)(4000MiB/662msec)
lz4: read: IOPS=1646k, BW=6431MiB/s (6743MB/s)(4000MiB/622msec)
lz4 fast dec: read: IOPS=1775k, BW=6932MiB/s (7269MB/s)(4000MiB/577msec)
Sequencial 4k read:
$ fio --readonly --name=zram_seqread --direct=1 --rw=read --ioengine=psync \
--numjobs=4 --iodepth=1 --group_reporting=1 --filename=/dev/block/zram0 \
--bs=4K --size=1000M
lzo-rle: read: IOPS=1816k, BW=7092MiB/s (7437MB/s)(4000MiB/564msec)
lz4: read: IOPS=1907k, BW=7449MiB/s (7811MB/s)(4000MiB/537msec)
lz4 fast dec: read: IOPS=2004k, BW=7828MiB/s (8208MB/s)(4000MiB/511msec)
Compression ratio from /sys/block/zram0/mm_stat
lzo-rle: 1048576000 -> 81969152
lz4: 1048576000 -> 86200320
zstd was also considered. It offers really nice compression ratio,
1048576000 -> 59899904, but the throughput and latency are so much
worse than lz4 and lzo-rle. It is probably more suitable for traditional
desktop/server swap setup with less aggressive swappiness value. It can
also help alleviate high memory pressure situation by compressing the
RAM to smaller size.
Starting with Android R launched devices, debugfs cannot be mounted in
production builds. In order to avoid accidental debugfs dependencies
from creeping in during development with userdebug/eng builds, the
build flag PRODUCT_SET_DEBUGFS_RESTRICTIONS can be set by vendors to
enforce additional debugfs restrictions for userdebug/eng builds. The
same flag will be used to enable sepolicy neveallow statements to
prevent new permissions added for debugfs access.
Test: build, boot
Bug: 184381659
Change-Id: I45e6f20c886d467a215c9466f3a09965ff897d7e