Commit dc8fa2bd authored by Kristian Klausen's avatar Kristian Klausen 🎉 Committed by Jelle van der Waa
Browse files

common: Replace deprecated systemd-swap[1] with zram-generator

zram-generator defaults to 50% of the ram where systemd-swap defaults to
25% of the ram.

[1] https://lists.archlinux.org/pipermail/arch-dev-public/2021-May/030429.html
parent 2322ca1c
# This file is part of systemd-swap.
#
# Entries in this file show the systemd-swap defaults as
# specified in /usr/share/systemd-swap/swap-default.conf
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See swap.conf(5) and /usr/share/systemd-swap/swap-default.conf for details.
zswap_enabled=0
#zswap_compressor=zstd
#zswap_max_pool_percent=25
#zswap_zpool=z3fold
zram_enabled=1
#zram_size=$(( RAM_SIZE / 4 ))
zram_count=1
#zram_streams=${NCPU}
#zram_alg=zstd
#zram_prio=32767
#swapfc_enabled=0
#swapfc_force_use_loop=0
#swapfc_frequency=1
#swapfc_chunk_size=256M
#swapfc_max_count=32
#swapfc_min_count=0
#swapfc_free_ram_perc=35
#swapfc_free_swap_perc=15
#swapfc_remove_free_swap_perc=55
#swapfc_priority=50
#swapfc_path=/var/lib/systemd-swap/swapfc/
#swapfc_nocow=1
#swapfc_directio=1
#swapfc_force_preallocated=0
#swapd_auto_swapon=1
#swapd_prio=1024
......@@ -19,5 +19,5 @@
- name: restart syslog-ng
service: name=syslog-ng@default state=restarted
- name: restart systemd-swap
service: name=systemd-swap state=restarted
- name: restart swap.target
service: name=swap.target state=restarted daemon_reload=yes
......@@ -131,18 +131,14 @@
notify:
- systemd daemon-reload
- name: install systemd-swap
pacman: name=systemd-swap state=present
- name: install zram-generator
pacman: name=zram-generator state=present
when: enable_zram_swap
- name: install systemd-swap config for zram
copy: src=zram-swap.conf dest=/etc/systemd/swap.conf owner=root group=root mode=0644
- name: install zram-generator config for zram
copy: src=zram-generator.conf dest=/etc/systemd/zram-generator.conf owner=root group=root mode=0644
notify:
- restart systemd-swap
when: enable_zram_swap
- name: start systemd-swap
service: name=systemd-swap state=started enabled=yes
- restart swap.target
when: enable_zram_swap
- name: start systemd-oomd
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment