Welcome to yet another mirror site for the BFQ (Budget Fair Queueing) I/O disk scheduler for Linux. Here you can get all the BFQ patches for the supported Linux kernel versions and follow the instructions below on how to patch the Linux kernel with these patches in order to be able to use the BFQ I/O disk scheduler.
Getting BFQ and patching the Linux kernel
NOTE: As of Linux kernel version 4.12, BFQ has been accepted into the mainline kernel. However, it is only available for blk-mq (Multi-Queue Block) so you will have to pass the kernel boot option scsi_mod.use_blk_mq=1 and manually select BFQ by issuing the following for each of your devices:
echo bfq > /sys/block/sdX/queue/scheduler (replace X appropriately)
Or you can create the file 70-block.rules in /etc/udev/rules.d with the below in it and it will set BFQ as default during boot.
ACTION=="add|change", KERNEL=="sd[a-z]|nvme[0-9]*", ATTR{queue/scheduler}="bfq"
- Download the correct BFQ patchset for the kernel version you'd like to patch from here.
- Place the patches inside the kernel source directory, open a console and navigate to the kernel source directory.
- Issue the following commands to patch the kernel (replace the ... below with the correct patch names):
- patch -p1 < 0001-...
- patch -p1 < 0002-...
- patch -p1 < 0003-...
- patch -p1 < 0004-...
- If all is successful, you can now go ahead and configure and compile the kernel. How to do so is beyond the scope of this short patch tutorial.
BFQ as a kernel module
BFQ can also be compiled as a Linux kernel module. If this is the case or if you installed it from your distro repo as a module, you need to do a few things in order to set it as the default disk scheduler. In the below example, you'll find instructions for openSUSE systems. If you use another distro, the below may differ so please Google a bit to find the appropriate steps. The below assumes you use openSUSE version 13.2 or higher and have built BFQ as a module or installed the BFQ KMP package for openSUSE from here.
- Open the file /etc/dracut.conf as root and modify the following variable to look like this:
- add_drivers+=
bfq-iosched
(note the spaces between the quotes and the module name).
- add_drivers+=
- Open the file /etc/default/grub as root and add to the GRUB_CMDLINE_LINUX_DEFAULT variable the following:
- elevator=bfq
- In a console as root, run the following two commands:
- dracut -f
- grub2-mkconfig -o /boot/grub2/grub.cfg
- Reboot your system and enjoy the greatness of BFQ!
BFQ in action
Paolo Valente, one of the main BFQ developers, has posted some videos comparing BFQ against the other Linux disk schedulers. Check them out!
Copyright © 2015-2024, Team Belgium | Server load: 9% | Page rendered in 0.016 seconds.