You are not logged in.
Hi,
I have my laptop set up with systemd-swap with zswap and swap file chunked enabled.
The systemd-swap github page mentions that my config won't work for hibernation. But I don't use hibernation, instead I use suspend to ram.
When I put my laptop into suspend via systemd, it will only resume if there is no swapped memory in use. Once the system reaches the point of swapping out memory, it will go into suspend and then not return when I try to wake it up.
$ cat /etc/systemd/swap.conf
################################################################################
# Defaults are optimized for general usage
################################################################################
################################################################################
# Zswap
#
# Kernel >= 3.11
# Zswap create compress cache between swap and memory for reduce IO
# https://www.kernel.org/doc/Documentation/vm/zswap.txt
zswap_enabled=1
zswap_compressor=lz4 # lzo lz4
zswap_max_pool_percent=25 # 1-99
zswap_zpool=z3fold # zbud z3fold
################################################################################
# ZRam
#
# Kernel >= 3.15
# Zram compression streams count for additional information see:
# 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_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=0
# 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=1
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_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/
################################################################################
# Swap devices
# Find and auto swapon all available swap devices
swapd_auto_swapon=1
swapd_prio=1024Excerpt from grub.cfg
menuentry 'Load Linux' {
cryptomount -a
set root=(crypto0)
linux /boot/vmlinuz-linux cryptdevice=UUID=XXXX:cryptroot:allow-discards root=UUID=XXXX rw ipv6.disable=1 quiet
initrd /boot/initramfs-linux.img
boot
}I'm considering trying a lts kernel since it's listed as a troubleshooting step with suspend issues, but at this point I'd like to follow up with the systemd-swap configuration and eliminate it as a cause.
Thanks.
Last edited by CTAG (2017-05-08 02:48:14)
Offline
The problem isn't resolved, but this isn't an issue with kernel swap utilities. Closing.
Offline