From a6660555cfc8d181c5facef140019eb5487dd63a Mon Sep 17 00:00:00 2001 From: Antoine Viallon Date: Fri, 8 Apr 2022 21:11:14 +0200 Subject: [PATCH] [Boot] Add option to set loops per jiffies, reducing boot time --- boot.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/boot.nix b/boot.nix index 6d2968c..6ca3d9e 100644 --- a/boot.nix +++ b/boot.nix @@ -73,6 +73,13 @@ in type = types.int; }; + loops_per_jiffies = mkOption { + description = "Set loops_per_jiffies to given constant, reducing boot-time. A value of 0 means autodetection."; + default = 0; + example = 4589490; + type = types.addCheck types.int (v: v > 500); + }; + cmdline = mkOption { description = "Kernel params as attributes (instead of list)"; default = { }; @@ -88,6 +95,10 @@ in aviallon.boot.cmdline = { "syscall.x32" = cfg.x32abi.enable; + # Sets loops_per_jiffy to given constant, thus avoiding time-consuming boot-time autodetection + # https://www.kernel.org/doc/html/v5.15/admin-guide/kernel-parameters.html + "lpj" = cfg.loops_per_jiffies; + }; boot = {