about summary refs log tree commit diff
path: root/pkgs/os-specific/linux/kernel/zen-kernels.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/linux/kernel/zen-kernels.nix')
-rw-r--r--pkgs/os-specific/linux/kernel/zen-kernels.nix59
1 files changed, 34 insertions, 25 deletions
diff --git a/pkgs/os-specific/linux/kernel/zen-kernels.nix b/pkgs/os-specific/linux/kernel/zen-kernels.nix
index 77d66ecd1d440..6c9d2da1e9db7 100644
--- a/pkgs/os-specific/linux/kernel/zen-kernels.nix
+++ b/pkgs/os-specific/linux/kernel/zen-kernels.nix
@@ -1,20 +1,22 @@
-{ lib, stdenv, fetchFromGitHub, buildLinux, ... } @ args:
+{ lib, stdenv, fetchFromGitHub, buildLinux, variant, ... } @ args:
 
 let
   # comments with variant added for update script
-  # ./update-zen.py zen
-  zenVariant = {
-    version = "6.9.7"; #zen
-    suffix = "zen1"; #zen
-    sha256 = "1hs238vpwna8fry65x2909npw97b8zyvbadigl1yqm6f4ibcmhkj"; #zen
-    isLqx = false;
-  };
-  # ./update-zen.py lqx
-  lqxVariant = {
-    version = "6.9.7"; #lqx
-    suffix = "lqx1"; #lqx
-    sha256 = "09z48hnjw0qfvn3b7gm9gs7ixki590wcgy7pm0cw2y41c67f725y"; #lqx
-    isLqx = true;
+  variants = {
+    # ./update-zen.py zen
+    zen = {
+      version = "6.10.5"; #zen
+      suffix = "zen1"; #zen
+      sha256 = "08ibz7560xsmlnrm8j13hxf8hjjcxfmnjdrwffqc81g9g6rvpqra"; #zen
+      isLqx = false;
+    };
+    # ./update-zen.py lqx
+    lqx = {
+      version = "6.10.5"; #lqx
+      suffix = "lqx1"; #lqx
+      sha256 = "09rscj20j94qkmvk0hlpjm6v1n1ndnkv2vl035gsp5lwggws2jqm"; #lqx
+      isLqx = true;
+    };
   };
   zenKernelsFor = { version, suffix, sha256, isLqx }: buildLinux (args // {
     inherit version;
@@ -31,7 +33,7 @@ let
 
     # This is based on the following sources:
     # - zen: https://gitlab.archlinux.org/archlinux/packaging/packages/linux-zen/-/blob/main/config
-    # - lqx: https://github.com/damentz/liquorix-package/blob/6.4/master/linux-liquorix/debian/config/kernelarch-x86/config-arch-64
+    # - lqx: https://github.com/damentz/liquorix-package/blob/6.8/master/linux-liquorix/debian/config/kernelarch-x86/config-arch-64
     # - Liquorix features: https://liquorix.net/
     # The list below is not exhaustive, so the kernels probably doesn't match
     # the upstream, but should bring most of the improvements that will be
@@ -43,7 +45,6 @@ let
       # FQ-Codel Packet Scheduling
       NET_SCH_DEFAULT = yes;
       DEFAULT_FQ_CODEL = yes;
-      DEFAULT_NET_SCH = freeform "fq_codel";
 
       # Preempt (low-latency)
       PREEMPT = lib.mkOverride 60 yes;
@@ -63,30 +64,44 @@ let
       RCU_FANOUT = freeform "64";
       RCU_FANOUT_LEAF = freeform "16";
       RCU_BOOST = yes;
-      RCU_BOOST_DELAY = freeform "500";
+      RCU_BOOST_DELAY = option (freeform "500");
       RCU_NOCB_CPU = yes;
       RCU_LAZY = yes;
+      RCU_DOUBLE_CHECK_CB_TIME = yes;
+
+      # BFQ I/O scheduler
+      IOSCHED_BFQ = lib.mkOverride 60 yes;
 
       # Futex WAIT_MULTIPLE implementation for Wine / Proton Fsync.
       FUTEX = yes;
       FUTEX_PI = yes;
 
+      # NT synchronization primitive emulation
+      NTSYNC = yes;
+
       # Preemptive Full Tickless Kernel at 1000Hz
       HZ = freeform "1000";
       HZ_1000 = yes;
+
+      # Alternative zpool for zswap
+      Z3FOLD = yes;
     } // lib.optionalAttrs (isLqx) {
       # Google's BBRv3 TCP congestion Control
       TCP_CONG_BBR = yes;
       DEFAULT_BBR = yes;
-      DEFAULT_TCP_CONG = freeform "bbr";
 
       # PDS Process Scheduler
       SCHED_ALT = yes;
       SCHED_PDS = yes;
 
+      # https://github.com/damentz/liquorix-package/commit/a7055b936c0f4edb8f6afd5263fe1d2f8a5cd877
+      RCU_BOOST = no;
+      RCU_LAZY = lib.mkOverride 60 no;
+
       # Swap storage is compressed with LZ4 using zswap
       ZSWAP_COMPRESSOR_DEFAULT_LZ4  = lib.mkOptionDefault yes;
       ZSWAP_COMPRESSOR_DEFAULT_ZSTD = lib.mkDefault no;
+      ZSWAP_ZPOOL_DEFAULT_Z3FOLD = yes;
 
       # Fix error: unused option: XXX.
       CFS_BANDWIDTH = lib.mkForce (option no);
@@ -96,9 +111,6 @@ let
       SCHED_CORE = lib.mkForce (option no);
       UCLAMP_TASK = lib.mkForce (option no);
       UCLAMP_TASK_GROUP = lib.mkForce (option no);
-
-      # ERROR: modpost: "sched_numa_hop_mask" [drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko] undefined!
-      MLX5_CORE = no;
     };
 
     passthru.updateScript = [ ./update-zen.py (if isLqx then "lqx" else "zen") ];
@@ -113,7 +125,4 @@ let
 
   } // (args.argsOverride or { }));
 in
-{
-  zen = zenKernelsFor zenVariant;
-  lqx = zenKernelsFor lqxVariant;
-}
+zenKernelsFor variants.${variant}