From ef1911d045df6052491632bcb621c15a8e8fb00d Mon Sep 17 00:00:00 2001 From: Danylo Hlynskyi Date: Thu, 7 Mar 2019 02:07:52 +0200 Subject: [PATCH] zram: revert "change default algorithm to zstd" (#56856) 19.03 default kernel is still 4.14, which doesn't support zstd. So, zramSwap in current fasion fails on default kernel. --- nixos/doc/manual/release-notes/rl-1903.xml | 2 +- nixos/modules/config/zram.nix | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-1903.xml b/nixos/doc/manual/release-notes/rl-1903.xml index bccd6bce4ed..18d32b59584 100644 --- a/nixos/doc/manual/release-notes/rl-1903.xml +++ b/nixos/doc/manual/release-notes/rl-1903.xml @@ -577,7 +577,7 @@ but is still possible by setting zramSwap.swapDevices explicitly. - Default algorithm for ZRAM swap was changed to zstd. + ZRAM algorithm can be changed now. Changes to ZRAM algorithm are applied during nixos-rebuild switch, diff --git a/nixos/modules/config/zram.nix b/nixos/modules/config/zram.nix index 925d945c081..5d411c73a56 100644 --- a/nixos/modules/config/zram.nix +++ b/nixos/modules/config/zram.nix @@ -91,13 +91,13 @@ in }; algorithm = mkOption { - default = "zstd"; - example = "lzo"; + default = "lzo"; + example = "lz4"; type = with types; either (enum [ "lzo" "lz4" "zstd" ]) str; description = '' Compression algorithm. lzo has good compression, but is slow. lz4 has bad compression, but is fast. - zstd is both good compression and fast. + zstd is both good compression and fast, but requires newer kernel. You can check what other algorithms are supported by your zram device with cat /sys/class/block/zram*/comp_algorithm '';