Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
infrastructure
Commits
b57312ba
Commit
b57312ba
authored
Feb 18, 2018
by
Bartłomiej Piotrowski
Browse files
archbuild: update systemd-swap config to reflect upstream changes
parent
c039df8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
roles/archbuild/files/swap.conf
View file @
b57312ba
...
...
@@ -17,7 +17,7 @@
zswap_enabled
=
1
zswap_compressor
=
lz4
# lzo lz4
zswap_max_pool_percent
=
25
# 1-99
zswap_zpool
=
z
3fold
# zbud z3fold
zswap_zpool
=
z
bud
# 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
=
1
s
# How often check free swap space
swapfc_chunk_size
=
256
M
# Allocate size of swap chunk
swapfc_max_count
=
16
# 0 - unlimited, note: 32 is a kernel maximum
swapfc_chunk_size
=
512
M
# 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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment