Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 31 additions & 16 deletions pkgs/os-specific/linux/kernel/zen-kernels.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
}@args:

let
# comments with variant added for update script
# Default priority is 100 for common kernel options (see common-config.nix
# file), we need something lower to override them, but we still want users to
# override options if they need using lib.mkForce (that has 50 priority)
mkKernelOverride = lib.mkOverride 90;
# Comments with variant added for update script
variants = {
# ./update-zen.py zen
zen = {
Expand Down Expand Up @@ -49,7 +53,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.8/master/linux-liquorix/debian/config/kernelarch-x86/config-arch-64
# - lqx: https://github.com/damentz/liquorix-package/blob/6.13/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
Expand All @@ -65,8 +69,8 @@ let
DEFAULT_FQ_CODEL = yes;

# Preempt (low-latency)
PREEMPT = lib.mkOverride 60 yes;
PREEMPT_VOLUNTARY = lib.mkOverride 60 no;
PREEMPT = mkKernelOverride yes;
PREEMPT_VOLUNTARY = mkKernelOverride no;

# Preemptible tree-based hierarchical RCU
TREE_RCU = yes;
Expand All @@ -88,7 +92,7 @@ let
RCU_DOUBLE_CHECK_CB_TIME = yes;

# BFQ I/O scheduler
IOSCHED_BFQ = lib.mkOverride 60 yes;
IOSCHED_BFQ = mkKernelOverride yes;

# Futex WAIT_MULTIPLE implementation for Wine / Proton Fsync.
FUTEX = yes;
Expand All @@ -103,6 +107,10 @@ let

}
// lib.optionalAttrs (isLqx) {
# https://github.com/damentz/liquorix-package/commit/07b176edc002f2a7825ae181613e1f79a3650fd2
CMDLINE_BOOL = yes;
CMDLINE = freeform "audit=0 intel_pstate=disable amd_pstate=disable ";

# Google's BBRv3 TCP congestion Control
TCP_CONG_BBR = yes;
DEFAULT_BBR = yes;
Expand All @@ -113,21 +121,28 @@ let

# https://github.com/damentz/liquorix-package/commit/a7055b936c0f4edb8f6afd5263fe1d2f8a5cd877
RCU_BOOST = no;
RCU_LAZY = lib.mkOverride 60 no;
RCU_LAZY = mkKernelOverride no;

# Swap storage is compressed with LZ4 using zswap
ZSWAP_COMPRESSOR_DEFAULT_LZ4 = lib.mkOptionDefault yes;
ZSWAP_COMPRESSOR_DEFAULT_ZSTD = lib.mkDefault no;
ZSWAP_COMPRESSOR_DEFAULT_LZ4 = yes;
ZSWAP_COMPRESSOR_DEFAULT_ZSTD = mkKernelOverride no;

# https://github.com/damentz/liquorix-package/commit/3a82381a4db3452599e2b2a607046a379c72ad27
SLAB_BUCKETS = mkKernelOverride (option no);
# https://github.com/damentz/liquorix-package/commit/ca7efe07abd478f3f4cbe0725a3383fd235aa5be
ENERGY_MODE = mkKernelOverride (option no);
# https://github.com/damentz/liquorix-package/commit/fdc93f5633d22c26f0994fba751a26de0cb51a17
WQ_POWER_EFFICIENT_DEFAULT = mkKernelOverride (option no);

# Fix error: unused option: XXX.
CFS_BANDWIDTH = lib.mkForce (option no);
PSI = lib.mkForce (option no);
RT_GROUP_SCHED = lib.mkForce (option no);
SCHED_AUTOGROUP = lib.mkForce (option no);
SCHED_CLASS_EXT = lib.mkForce (option no);
SCHED_CORE = lib.mkForce (option no);
UCLAMP_TASK = lib.mkForce (option no);
UCLAMP_TASK_GROUP = lib.mkForce (option no);
CFS_BANDWIDTH = mkKernelOverride (option no);
PSI = mkKernelOverride (option no);
RT_GROUP_SCHED = mkKernelOverride (option no);
SCHED_AUTOGROUP = mkKernelOverride (option no);
SCHED_CLASS_EXT = mkKernelOverride (option no);
SCHED_CORE = mkKernelOverride (option no);
UCLAMP_TASK = mkKernelOverride (option no);
UCLAMP_TASK_GROUP = mkKernelOverride (option no);
};

passthru.updateScript = [
Expand Down