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.
This commit is contained in:
rnhmjoj 2021-02-26 21:37:33 +01:00
parent ed0a29c88d
commit 48052ca0dd
No known key found for this signature in database
GPG Key ID: BFBAF4C975F76450
2 changed files with 8 additions and 8 deletions

View File

@ -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
'';
};
};
}

View File

@ -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 ];
};