From 08b615319da54999f453afa20160d0c93e83acf2 Mon Sep 17 00:00:00 2001 From: dr460nf1r3 Date: Fri, 2 Jul 2021 11:03:30 +0200 Subject: [PATCH] Add the proposed changes concerning replacing daemons & adjusting sysctl values --- PKGBUILD | 26 ++++++------- etc/sysctl.d/99-sysctl-garuda.conf | 39 +------------------ etc/systemd/swap.conf.d/swap.conf | 5 --- etc/systemd/zram-generator.conf | 23 +++++++++++ etc/xdg/autostart/snapshot-detect.desktop | 2 +- garuda-common-settings.install | 21 +--------- .../{snapshot-detect.sh => snapshot-detect} | 0 usr/bin/update | 2 +- 8 files changed, 42 insertions(+), 76 deletions(-) delete mode 100644 etc/systemd/swap.conf.d/swap.conf create mode 100644 etc/systemd/zram-generator.conf rename usr/bin/{snapshot-detect.sh => snapshot-detect} (100%) diff --git a/PKGBUILD b/PKGBUILD index 6d6035b..0b672b4 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -11,21 +11,21 @@ makedepends=('coreutils') source=("$pkgname-$pkgver.tar.gz::$url/-/archive/$pkgver/$pkgname-$pkgver.tar.gz") sha256sums=('SKIP') pkgdesc='Garuda Linux common settings' -depends=('garuda-icons' - 'garuda-browser-settings' - 'garuda-hooks' - 'haveged' - 'irqbalance' - 'systemd-swap' - 'nohang' - 'prelockd' +depends=('btrfsmaintenance' + 'garuda-browser-settings' + 'garuda-hooks' + 'garuda-icons' + 'haveged' 'memavaild' - 'uresourced' - 'ananicy' - 'profile-sync-daemon' 'preload' - 'btrfsmaintenance') -optdepends=('performance-tweaks') + 'prelockd' + 'profile-sync-daemon' + 'zram-generator') +optdepends=('ananicy: Automatically set nice levels for apps' + 'irqbalance: Better distribute load between CPUs' + 'performance-tweaks: Tuning for best performance' + 'powersave-tweaks: Tuning for lower power usage' + 'uresourced: Allocate more ressources for the graphical user') makedepends=('polkit') install=$pkgname.install diff --git a/etc/sysctl.d/99-sysctl-garuda.conf b/etc/sysctl.d/99-sysctl-garuda.conf index 3b756ad..a9713ee 100644 --- a/etc/sysctl.d/99-sysctl-garuda.conf +++ b/etc/sysctl.d/99-sysctl-garuda.conf @@ -1,13 +1,8 @@ # The swappiness sysctl parameter represents the kernel's preference (or avoidance) of swap space. Swappiness can have a value between 0 and 100, the default value is 60. # A low value causes the kernel to avoid swapping, a higher value causes the kernel to try to use swap space. Using a low value on sufficient memory is known to improve responsiveness on many systems. -vm.swappiness=10 +vm.swappiness=133 -# The value controls the tendency of the kernel to reclaim the memory which is used for caching of directory and inode objects (VFS cache). -# Lowering it from the default value of 100 makes the kernel less inclined to reclaim VFS cache (do not set it to 0, this may produce out-of-memory conditions) -vm.vfs_cache_pressure=75 - -# This action will speed up your boot and shutdown, because one less module is loaded. Additionally disabling watchdog timers increases performance and lowers power consumption -# Disable NMI watchdog +# Disable NMI watchdog: This action will speed up your boot and shutdown, because one less module is loaded. Additionally disabling watchdog timers increases performance and lowers power consumption kernel.nmi_watchdog = 0 # Enable the sysctl setting kernel.unprivileged_userns_clone to allow normal users to run unprivileged containers. @@ -15,33 +10,3 @@ kernel.unprivileged_userns_clone=1 # To hide any kernel messages from the console kernel.printk = 3 3 3 3 - - - -###############-NOT USED-################# - -# The kernel default is to buffer up to 10% of system RAM before flushing writes to the disk, which is insane. By setting a reasonable number of bytes for the `dirty_bytes` parameter, we can avoid sending the system into OOM during a large file transfer. -#vm.dirty_bytes = 16777216 -#vm.dirty_background_bytes = 4194304 - -# Contains, as a percentage of total available memory that contains free pages and reclaimable -# pages, the number of pages at which a process which is generating disk writes will itself start -# writing out dirty data (Default is 20). -#vm.dirty_ratio = 10 - -# Contains, as a percentage of total available memory that contains free pages and reclaimable -# pages, the number of pages at which the background kernel flusher threads will start writing out -# dirty data (Default is 10). -#vm.dirty_background_ratio = 5 - -# This tunable is used to define when dirty data is old enough to be eligible for writeout by the -# kernel flusher threads. It is expressed in 100'ths of a second. Data which has been dirty -# in-memory for longer than this interval will be written out next time a flusher thread wakes up -# (Default is 3000). -#vm.dirty_expire_centisecs = 3000 - -# The kernel flusher threads will periodically wake up and write `old' data out to disk. This -# tunable expresses the interval between those wakeups, in 100'ths of a second (Default is 500). -#vm.dirty_writeback_centisecs = 1500 - -########################################### diff --git a/etc/systemd/swap.conf.d/swap.conf b/etc/systemd/swap.conf.d/swap.conf deleted file mode 100644 index fab386b..0000000 --- a/etc/systemd/swap.conf.d/swap.conf +++ /dev/null @@ -1,5 +0,0 @@ -zram_enabled=1 -zswap_enabled=0 -swapfc_enabled=0 -zram_size=$(( RAM_SIZE )) - diff --git a/etc/systemd/zram-generator.conf b/etc/systemd/zram-generator.conf new file mode 100644 index 0000000..814642c --- /dev/null +++ b/etc/systemd/zram-generator.conf @@ -0,0 +1,23 @@ +[zram0] +host-memory-limit = none +zram-fraction = 0.25 +max-zram-size = none +compression-algorithm = lzo-rle + +[zram1] +host-memory-limit = none +zram-fraction = 0.25 +max-zram-size = none +compression-algorithm = lzo-rle + +[zram2] +host-memory-limit = none +zram-fraction = 0.25 +max-zram-size = none +compression-algorithm = lzo-rle + +[zram3] +host-memory-limit = none +zram-fraction = 0.25 +max-zram-size = none +compression-algorithm = lzo-rle diff --git a/etc/xdg/autostart/snapshot-detect.desktop b/etc/xdg/autostart/snapshot-detect.desktop index b10a061..950f27e 100644 --- a/etc/xdg/autostart/snapshot-detect.desktop +++ b/etc/xdg/autostart/snapshot-detect.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Name=Snapshot Detect Icon=timeshift -Exec=/usr/bin/snapshot-detect.sh +Exec=/usr/bin/snapshot-detect Terminal=false Type=Application diff --git a/garuda-common-settings.install b/garuda-common-settings.install index 7cada4a..b2e8631 100644 --- a/garuda-common-settings.install +++ b/garuda-common-settings.install @@ -7,7 +7,6 @@ msg() { } post_install() { - systemctl enable ananicy systemctl enable btrfs-balance.timer systemctl enable btrfs-defrag.timer systemctl enable btrfs-scrub.timer @@ -15,18 +14,14 @@ post_install() { systemctl enable fstrim.timer systemctl enable grub-btrfs.path systemctl enable haveged - systemctl enable irqbalance systemctl enable memavaild - systemctl enable nohang-desktop systemctl enable preload systemctl enable prelockd - systemctl enable systemd-swap - systemctl enable uresourced + systemctl enable systemd-oomd } post_upgrade() { msg "Attempting to enable services..." - systemctl is-active ananicy >/dev/null || systemctl enable ananicy systemctl is-active btrfs-balance.timer >/dev/null || systemctl enable btrfs-balance.timer systemctl is-active btrfs-defrag.timer >/dev/null || systemctl enable btrfs-defrag.timer systemctl is-active btrfs-scrub.timer >/dev/null || systemctl enable btrfs-scrub.timer @@ -34,22 +29,10 @@ post_upgrade() { systemctl is-active fstrim.timer >/dev/null || systemctl enable fstrim.timer systemctl is-active grub-btrfs.path >/dev/null || systemctl enable grub-btrfs.path systemctl is-active haveged >/dev/null || systemctl enable haveged - systemctl is-active irqbalance >/dev/null || systemctl enable irqbalance systemctl is-active memavaild >/dev/null || systemctl enable memavaild - systemctl is-active nohang-desktop >/dev/null || systemctl enable nohang-desktop systemctl is-active preload >/dev/null || systemctl enable preload systemctl is-active prelockd >/dev/null || systemctl enable prelockd - systemctl is-active uresourced >/dev/null || systemctl enable uresourced - systemctl is-active systemd-swap >/dev/null || systemctl enable systemd-swap - - echo "" - msg "Deactivating pacman-init & initializing keyrings" - echo "" - systemctl disable --now pacman-init - pacman-key --init - pacman-key --populate chaotic - pacman-key --populate archlinux - pacman -Qs blackarch-keyring && pacman-key --populate blackarch + systemctl is-active systemd-oomd >/dev/null || systemctl enable systemd-oomd msg "Updating font cache..." mkfontscale /usr/share/fonts/TTF /usr/share/fonts/OTF /usr/share/fonts/misc > /dev/null 2>&1 diff --git a/usr/bin/snapshot-detect.sh b/usr/bin/snapshot-detect similarity index 100% rename from usr/bin/snapshot-detect.sh rename to usr/bin/snapshot-detect diff --git a/usr/bin/update b/usr/bin/update index ff74c10..589a5f3 100755 --- a/usr/bin/update +++ b/usr/bin/update @@ -19,7 +19,7 @@ echo "Checking for keyring update, then update as needed.." if pacman -Qs blackarch-keyring; then sudo pacman -Sy archlinux-keyring blackarch-keyring chaotic-keyring --needed && $upd_cmd else sudo pacman -Sy archlinux-keyring chaotic-keyring --needed && $upd_cmd -fi +fi echo "" # Update mlocate index