nixos/ksm: remove udev-settle dependency

The sysfs file /sys/kernel/mm/ksm/run seems to be available as soon as
the kernel has started, so no point in waiting for udev to "settle". If
for some reason it doesn't, we let the unit fail explicitly.
wip/yesman
rnhmjoj 3 years ago
parent ed0a29c88d
commit 48052ca0dd
No known key found for this signature in database
GPG Key ID: BFBAF4C975F76450
  1. 12
      nixos/modules/hardware/ksm.nix
  2. 4
      nixos/tests/ksm.nix

@ -26,13 +26,13 @@ in {
systemd.services.enable-ksm = {
description = "Enable Kernel Same-Page Merging";
wantedBy = [ "multi-user.target" ];
after = [ "systemd-udev-settle.service" ];
script = ''
if [ -e /sys/kernel/mm/ksm ]; then
script =
''
echo 1 > /sys/kernel/mm/ksm/run
${optionalString (cfg.sleep != null) ''echo ${toString cfg.sleep} > /sys/kernel/mm/ksm/sleep_millisecs''}
fi
'';
'' + optionalString (cfg.sleep != null)
''
echo ${toString cfg.sleep} > /sys/kernel/mm/ksm/sleep_millisecs
'';
};
};
}

@ -1,8 +1,8 @@
import ./make-test-python.nix ({ pkgs, ...} :
import ./make-test-python.nix ({ lib, ...} :
{
name = "ksm";
meta = with pkgs.lib.maintainers; {
meta = with lib.maintainers; {
maintainers = [ rnhmjoj ];
};

Loading…
Cancel
Save