about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--modules/system/kernel/zswap.nix12
1 files changed, 10 insertions, 2 deletions
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