Improving Desktop Responsiveness on Arch Linux

kernel

There are two kernels that I have used for better desktop responsiveness: linux-ck and linux-zen. linux-zen is in the official repo which makes it very easy to install.

  1. pacman -S linux-zen

Update your grub config if you need to.

nice

nice represents the priority of a process. X11 should have a higher priority for better responsiveness. verynice and ananicy will automatically set the nice levels based on rules.

  1. yaourt ananicy-git
  2. systemctl start ananicy && systemctl enable ananicy

sysctl

https://www.kernel.org/doc/Documentation/sysctl/vm.txt

swappiness is used to define how aggressive the kernel will swap memory pages.

vfs_cache_pressure value controls the tendency of the kernel to reclaim the memory which is used for caching of directory and inode objects.

zwap compresses the swap pages instead of moving them to the swap file right away.

  1. /etc/sysctl.d/10-vm.conf
    • vm.swappiness = 1
    • vm.vfs_cache_pressure = 50
    • zswap.enabled=1

blk-mq

This should help with multithreaded workloads.

  1. Add scsi_mod.use_blk_mq=1 to your kernel paremeters.
  2. Create /etc/udev/rules.d/60-ioschedulers.rules and add:
    • 1
      2
      3
      4
      # set scheduler for non-rotating disks
      ACTION=="add|change", KERNEL=="sd[a-z]|mmcblk[0-9]*|nvme[0-9]*", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="mq-deadline"
      # set scheduler for rotating disks
      ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="bfq"

Improving performance