From 553c6d609d2e7ea169769d566d9a58ed0322e583 Mon Sep 17 00:00:00 2001 From: chn Date: Mon, 19 Jun 2023 14:40:12 +0800 Subject: [PATCH] use bfq --- modules/boot/chn-PC.nix | 8 +++++++- modules/filesystem/chn-PC.nix | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/boot/chn-PC.nix b/modules/boot/chn-PC.nix index 59b6658e..25e77f98 100644 --- a/modules/boot/chn-PC.nix +++ b/modules/boot/chn-PC.nix @@ -9,7 +9,7 @@ # initrd 里有的模块 initrd.availableKernelModules = [ - "ahci" "i915" "intel_cstate" "nls_cp437" "nls_iso8859-1" "nvidia" "nvidia_drm" "nvidia_modeset" + "ahci" "bfq" "i915" "intel_cstate" "nls_cp437" "nls_iso8859-1" "nvidia" "nvidia_drm" "nvidia_modeset" "nvidia_uvm" "nvme" "sr_mod" "usbhid" "usb_storage" "virtio_blk" "virtio_pci" "xhci_pci" ]; @@ -29,5 +29,11 @@ resumeDevice = "/dev/mapper/root"; }; hardware.cpu.intel.updateMicrocode = true; + + services.udev.extraRules = + '' + ACTION=="add|change", KERNEL=="[sv]d[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="bfq" + ACTION=="add|change", KERNEL=="nvme[0-9]n[0-9]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="bfq" + ''; }; } diff --git a/modules/filesystem/chn-PC.nix b/modules/filesystem/chn-PC.nix index f2c29115..37e469b5 100644 --- a/modules/filesystem/chn-PC.nix +++ b/modules/filesystem/chn-PC.nix @@ -9,6 +9,8 @@ fsType = "tmpfs"; options = [ "size=16G" "relatime" "mode=755" ]; }; + # disable CoW for VM image and database + # sudo chattr +C images "/nix" = { device = "/dev/mapper/root";