编程知识 cdmana.com

Open BFQ and muqss for archlinux

Recently Arch When we update the system on , It's always the case that the graphics are completely stuck , This morning, I suddenly remembered that I had set up to use noop Of IO Dispatch , Guess it's because of this . And then on the principle of not being uncomfortable , Intended use ck On the kernel MuQSS Process scheduling and BFQ Of IO Dispatch .

ck The kernel is not in arch The warehouse of , however aur Yes linux-ck My bag , Just install it .

yay -S linux-ck linux-ck-headers

It takes some time to compile , In my broken book i7-8550U Compiled a time to cross the bridge rice noodles , And then it successfully used ck kernel .

Turn on MuQSS

ck By default, the kernel uses MuQSS Dispatch , There's no need to change anything , Turn it on .

Turn on BFQ

Turn on BFQ You need some manual settings . Divided into two steps :

  1. modify grub, Give the kernel new parameters
  2. Use udev Turn on dynamic adjustment

modify grub

edit /etc/default/grub in GRUB_CMDLINE_LINUX_DEFAULT, Add a line :

GRUB_CMDLINE_LINUX_DEFAULT="quiet scsi_mod.use_blk_mq=1"

And then update grub The configuration file :

sudo grub-mkconfig -o /boot/grub/grub.cfg

establish udev The rules

Create and edit /etc/udev/rules.d/60-scheduler.rules

# set deadline scheduler for non-rotating disks
ACTION=="add|change", KERNEL=="sd[a-z]", TEST!="queue/rotational", ATTR{queue/scheduler}="deadline"
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="bfq"

# set cfq scheduler for rotating disks
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="bfq"
ACTION=="add|change", KERNEL=="nvme[0-9]n1", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="bfq"

The above configuration is for SSD use deadline, For mechanical disks bfq, to nvme disc bfq.

In line with the computer only ssd, So the principle that heaven is not afraid of the earth , I choose to use it all bfq.

Then restart the computer , View all hard disk schedulers :

# justforlxz @ archlinux in ~ [13:29:04]
$ cat /sys/block/*/queue/scheduler
mq-deadline kyber [bfq] none
mq-deadline kyber [bfq] none

adopt dmesg see MuQSS Open or not :

$ sudo dmesg | grep -i scheduler
Alias tip: _ dmesg | grep -i scheduler
[    0.295872] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    1.223982] io scheduler mq-deadline registered
[    1.223984] io scheduler kyber registered
[    1.224038] io scheduler bfq registered
[    1.586191] MuQSS CPU scheduler v0.193 by Con Kolivas.

summary

MuQSS yes BFS( Brain damage scheduler ) The evolution of , The main thing is to improve BFS Of O(n) Complexity ,BFS For desktop users , Can provide better process switching and latency . BFQ It's for hard drives IO Dispatch , It's by pre allocating a certain amount of IO The throughput is used to arrange the throughput of each process IO operation . I need a few days to feel MuQSS and CFQ The benefits of .

版权声明
本文为[justforlxz]所创,转载请带上原文链接,感谢

Scroll to Top