From b215ccdf1cc7a8d87167fb775097ffa738a888fe Mon Sep 17 00:00:00 2001 From: K900 Date: Sat, 7 Mar 2026 20:36:43 +0300 Subject: [PATCH] linux/common-config: update for 7.0, tweak preemption settings --- pkgs/os-specific/linux/kernel/common-config.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix index 23b8aabf4e9a..66859facc6d9 100644 --- a/pkgs/os-specific/linux/kernel/common-config.nix +++ b/pkgs/os-specific/linux/kernel/common-config.nix @@ -575,7 +575,7 @@ let # Enable Hyper-V Synthetic DRM Driver DRM_HYPERV = whenAtLeast "5.14" module; # And disable the legacy framebuffer driver when we have the new one - FB_HYPERV = whenAtLeast "5.14" no; + FB_HYPERV = whenBetween "5.14" "7.0" no; } // lib.optionalAttrs (stdenv.hostPlatform.system == "x86_64-linux") { # Intel GVT-g graphics virtualization supports 64-bit only @@ -739,7 +739,9 @@ let NFS_FSCACHE = yes; NFS_SWAP = yes; NFS_V3_ACL = yes; - NFS_V4_1 = yes; # NFSv4.1 client support + # NFSv4.1 is enabled unconditionally on 7.0 and up + # see: https://github.com/torvalds/linux/commit/7537db24806fdc3d3ec4fef53babdc22c9219e75 + NFS_V4_1 = whenOlder "7.0" yes; NFS_V4_2 = yes; NFS_V4_SECURITY_LABEL = yes; NFS_LOCALIO = whenAtLeast "6.12" yes; @@ -1168,7 +1170,7 @@ let ACCESSIBILITY = yes; # Accessibility support AUXDISPLAY = yes; # Auxiliary Display support - HIPPI = yes; + HIPPI = whenOlder "7.0" yes; MTD_COMPLEX_MAPPINGS = yes; # needed for many devices SCSI_LOWLEVEL = yes; # enable lots of SCSI devices @@ -1378,8 +1380,14 @@ let HMM_MIRROR = yes; DRM_AMDGPU_USERPTR = yes; + # We want to prefer PREEMPT_LAZY when available, and fall back on PREEMPT_VOLUNTARY. + # It just so happens that kconfig asks for PREEMPT_LAZY first, so doing it like this + # does what we want. + # FIXME: This is stupid and bad. + # See: https://github.com/torvalds/linux/commit/7dadeaa6e851e7d67733f3e24fc53ee107781d0f PREEMPT = no; - PREEMPT_VOLUNTARY = yes; + PREEMPT_LAZY = option yes; + PREEMPT_VOLUNTARY = option yes; X86_AMD_PLATFORM_DEVICE = lib.mkIf stdenv.hostPlatform.isx86 yes; X86_PLATFORM_DRIVERS_DELL = lib.mkIf stdenv.hostPlatform.isx86 (whenAtLeast "5.12" yes);