From a15e8ba52bcc079f1144cd9e532064d079a5e722 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 11 Mar 2022 12:53:19 +0100 Subject: luksroot: bypassWorkqueues --- modules/luksroot.nix | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'modules/luksroot.nix') diff --git a/modules/luksroot.nix b/modules/luksroot.nix index abaee692..52de2c40 100644 --- a/modules/luksroot.nix +++ b/modules/luksroot.nix @@ -140,9 +140,12 @@ let umount /crypt-ramfs 2>/dev/null ''; - openCommand = name': { name, device, header, keyFile, keyFileSize, keyFileOffset, allowDiscards, yubikey, gpgCard, fido2, clevis, dmi, fallbackToPassword, preOpenCommands, postOpenCommands, ... }: assert name' == name; + openCommand = name': { name, device, header, keyFile, keyFileSize, keyFileOffset, allowDiscards, bypassWorkqueues, yubikey, gpgCard, fido2, clevis, dmi, fallbackToPassword, preOpenCommands, postOpenCommands, ... }: assert name' == name; let - csopen = "cryptsetup luksOpen ${device} ${name} ${optionalString allowDiscards "--allow-discards"} ${optionalString (header != null) "--header=${header}"}"; + csopen = "cryptsetup luksOpen ${device} ${name}" + + optionalString allowDiscards " --allow-discards" + + optionalString bypassWorkqueues " --perf-no_read_workqueue --perf-no_write_workqueue" + + optionalString (header != null) " --header=${header}"; cschange = "cryptsetup luksChangeKey ${device} ${optionalString (header != null) "--header=${header}"}"; in '' # Wait for luksRoot (and optionally keyFile and/or header) to appear, e.g. @@ -658,6 +661,17 @@ in ''; }; + bypassWorkqueues = mkOption { + default = false; + type = types.bool; + description = '' + Whether to bypass dm-crypt's internal read and write workqueues. + Enabling this should improve performance on SSDs; see + here + for more information. Needs Linux 5.9 or later. + ''; + }; + fallbackToPassword = mkOption { default = false; type = types.bool; -- cgit v1.2.3