diff --git a/packages/bsp/common/etc/default/armbian-zram-config.dpkg-dist b/packages/bsp/common/etc/default/armbian-zram-config.dpkg-dist index 558891fe13..a3ceb38c28 100644 --- a/packages/bsp/common/etc/default/armbian-zram-config.dpkg-dist +++ b/packages/bsp/common/etc/default/armbian-zram-config.dpkg-dist @@ -11,11 +11,12 @@ ENABLED=true # create how many zram devices max for swap # ZRAM_MAX_DEVICES=4 -# Which algorithm to choose for zram based swapping -# SWAP_ALGORITHM=lz4 +# Which algorithm for zram based swapping. Seems lzo is best choice on ARM: +# https://forum.armbian.com/topic/8161-swap-on-sbc/?do=findComment&comment=61668 +# SWAP_ALGORITHM=lzo # Which algorithm to choose for zram based ramlog partition # RAMLOG_ALGORITHM=zstd # Which algorithm to choose for zram based /tmp -# TMP_ALGORITHM=lz4hc +# TMP_ALGORITHM=zstd diff --git a/packages/bsp/common/usr/lib/armbian/armbian-zram-config b/packages/bsp/common/usr/lib/armbian/armbian-zram-config index 4143873ba6..ddcb0b1585 100755 --- a/packages/bsp/common/usr/lib/armbian/armbian-zram-config +++ b/packages/bsp/common/usr/lib/armbian/armbian-zram-config @@ -41,7 +41,7 @@ activate_zram_swap() { memory_total=$(awk '{printf("%d",$2*1024)}' <<<${mem_info}) mem_per_zram_device=$(( ${memory_total} / ${zram_devices} * ${zram_percent} / 100 )) - swap_algo=${SWAP_ALGORITHM:=lz4} + swap_algo=${SWAP_ALGORITHM:=lzo} for (( i=1; i<=zram_devices; i++ )); do [[ -f /sys/block/zram${i}/comp_algorithm ]] && echo ${swap_algo} >/sys/block/zram${i}/comp_algorithm 2>/dev/null echo -n ${mem_per_zram_device} > /sys/block/zram${i}/disksize