From 0b83e6efe7ec2d3bd0000422e04f1c13a953f39a Mon Sep 17 00:00:00 2001 From: aszlig Date: Sat, 21 Jul 2018 16:56:12 +0200 Subject: zswap: Add patch to fix crash for z3fold I now experienced the crash for the second time whenever my machine starts swapping. The details about the crash(es) and the corresponding fix can be found at: https://bugs.chromium.org/p/chromium/issues/detail?id=822360 When the patch lands in mainline and stable, we can revert this very commit. Signed-off-by: aszlig --- modules/system/kernel/zswap.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'modules/system/kernel') diff --git a/modules/system/kernel/zswap.nix b/modules/system/kernel/zswap.nix index eabe4931..007c6ae4 100644 --- a/modules/system/kernel/zswap.nix +++ b/modules/system/kernel/zswap.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ config, pkgs, lib, ... }: let kernelVersion = config.boot.kernelPackages.kernel.version; @@ -20,7 +20,15 @@ in { config = lib.mkIf config.vuizvui.system.kernel.zswap.enable { boot.kernelPatches = lib.singleton { name = "zswap-config"; - patch = null; + # This patch is needed until it hits stable/mainline to prevent z3fold + # crashes. + # + # See also: https://bugs.chromium.org/p/chromium/issues/detail?id=822360 + patch = pkgs.fetchpatch { + name = "z3fold-fix-wrong-handling-of-headless-pages.patch"; + url = "https://patchwork.kernel.org/patch/10510583/raw/"; + sha256 = "0c9l912zgxwy31b7m4xkf31imzvjs11n1i6v5w2sykqfx3sk6a3b"; + }; extraConfig = '' CRYPTO_${if hasZstd then "ZSTD" else "LZO"} y ZSWAP y -- cgit 1.4.1