This commit is contained in:
ThomasKaiser 2018-09-11 14:33:27 +02:00
parent 00d44fe40f
commit 845baff038
2 changed files with 5 additions and 4 deletions

View File

@ -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

View File

@ -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