Skip to content
Snippets Groups Projects
Commit b57312ba authored by Bartłomiej Piotrowski's avatar Bartłomiej Piotrowski
Browse files

archbuild: update systemd-swap config to reflect upstream changes

parent c039df8c
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@
zswap_enabled=1
zswap_compressor=lz4 # lzo lz4
zswap_max_pool_percent=25 # 1-99
zswap_zpool=z3fold # zbud z3fold
zswap_zpool=zbud # zbud z3fold
################################################################################
# ZRam
......@@ -27,62 +27,28 @@ zswap_zpool=z3fold # zbud z3fold
# https://www.kernel.org/doc/Documentation/blockdev/zram.txt
zram_enabled=0
zram_size=$(($ram_size/4))K # This is 1/4 of ram size by default.
zram_streams=$cpu_count
zram_size=$(($RAM_SIZE/4)) # This is 1/4 of ram size by default.
zram_streams=$NCPU
zram_alg=lz4 # lzo lz4 deflate lz4hc 842 - for Linux 4.8.4
zram_prio=32767 # 1 - 32767
################################################################################
# Swap File Universal
# loop + swapfile = support any fs (also btrfs)
swapfu_enabled=1
# File is sparse and dynamically allocated.
swapfu_size=${ram_size}K # Size of swap file.
# But you may don't like it, ex. in a case when you don't have much free space
swapfu_preallocated=0
# Don't use cow (btrfs)
swapfu_nocow=1
# Set directio for loop device
# If enabled, can be more safe in case of memory OOM
swapfu_directio=0
# Test setup:
# files with size 2G (mounted by loop), fs: btrfs
# fio: test 4k, randrw, iodepth 64, libaio, directio 1
# HDD 1TB 5400k
# Loop device:
# PREALLOC | NoCoW | DirectIO | ~ IO/s | Comment
# - | - | - | 2400 | NOT stable speed
# + | - | - | 160 | stable speed, HORRIBLY SLOW
# - | + | - | 3300 | stable speed, can degraded by time
# + | + | - | 2000 | stable speed
# - | - | + | 50 | not stable speed
# + | - | + | 69 | not stable speed
# - | + | + | 63 | not stable speed
# + | + | + | 75 | not stable speed
# raw file (loop device are slow):
# PREALLOC | NoCoW | DirectIO | ~ IO/s | Comment
# - | - | + | 7600 | not stable speed
# + | - | + | 69 | not stable speed
# - | + | + | 13000 | not stable speed
# + | + | + | 174 | not stable speed
# File will not be available in fs after script start
# Make sure what script can access to this path during the boot process.
# Full path to swapfile
swapfu_path=/var/lib/systemd-swap/swapfu
swapfu_prio=1 # 1 - 32767
################################################################################
# Swap File Chunked
# Allocate swap files dynamically
# Min swap size 256M, Max 16*256M
swapfc_enabled=0
# For btrfs fallback to swapfile + loop will be used
# ex. Min swap size 512M, Max 8*512M
swapfc_enabled=1
swapfc_force_use_loop=0 # Force usage of swapfile + loop
swapfc_frequency=1s # How often check free swap space
swapfc_chunk_size=256M # Allocate size of swap chunk
swapfc_max_count=16 # 0 - unlimited, note: 32 is a kernel maximum
swapfc_chunk_size=512M # Allocate size of swap chunk
swapfc_max_count=8 # 0 - unlimited, note: 32 is a kernel maximum
swapfc_free_swap_perc=15 # Add new chunk if free < 15%
# Remove chunk if free > 15+40% & chunk count > 2
swapfc_path=/var/lib/systemd-swap/swapfc/
# Only for swapfile + loop
swapfc_nocow=1 # Disable CoW on swapfile
swapfc_directio=1 # Use directio for loop dev
swapfc_force_preallocated=0 # Will preallocate created files
################################################################################
# Swap devices
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment