about summary refs log tree commit diff
path: root/modules/system
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2018-07-21 16:56:12 +0200
committeraszlig <aszlig@nix.build>2018-07-21 17:05:41 +0200
commit0b83e6efe7ec2d3bd0000422e04f1c13a953f39a (patch)
treed5e54de03b735e9a1908d54f9b0879f604232fd7 /modules/system
parent4308d4ba66ccb74510b59bedb6ad39e7dba73dc0 (diff)
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 <aszlig@nix.build>
Diffstat (limited to 'modules/system')
-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