Related to a question on which is better, the CFS or BFS scheduler:
Where do I find a list of which schedulers are available?
And how do I switch between them?
Related to a question on which is better, the CFS or BFS scheduler:
Where do I find a list of which schedulers are available?
And how do I switch between them?
Having researched this a bit, there seems to be only two schedulers for Linux: CFS and BFS.
The simplest way to install BFS in Ubuntu 10.10 is a PPA patch:
You can also install the patch using the Ubuntu Software Center as described in "What are PPAs and how do I use them".
The patch installs a new (patched) kernel, which will show up in the GRUB menu at boot with the suffix "-ck". Switch between schedulers by rebooting and selecting the appropriate kernel in the boot menu.
On performance
In my case, running Folding@Home in the background on a desktop PC (eight F@H threads on eight cores on an Intel i7 2600K), BFS is significantly better: Desktop response is snappier (not a big difference, but definitely noticeable) while the background F@H application is 20-25% faster.
In this scenario, dealing with interactive desktop use and long-running CPU-heavy background tasks simultaneously, CFS tended to leave one core idle for long periods at a time. BFS appears much better at using all cores 100% for background tasks while still providing fast response for interactive desktop tasks.
There is probably no single scheduler that will perform optimally under every possible combination of loads, but there are cases where BFS is better.
You will have to download, patch, and compile your own kernel because BFS is currently not part of the mainline kernel. The mainline kernel contains only one scheduler and is not meant to have multiple schedulers in the same codebase, or even on-the-fly switchable schedulers (it that's even something that could possibly be done). It would simply be too complicated, and not worth the effort.
So, in order to get BFS on your system:
The benefit of running BFS over CFS is very small though, especially with newer kernel versions. Keep in mind that CFS is constantly being improved.
The below worked for me on Precise Pangolin (Ubuntu 12.04) YMMV, though.
BFS is Part of
pf-kernel
The best way to install BFS on an Ubuntu system today (December 2013) seem to be to install pf-kernel, which is basically a standard kernel with a bunch of performance patches applied. These patches include:
Instructions on the Web
I found some instructions on how to install the
pf-kernel
packages for Ubuntu in the article “Get Better Linux Desktop Performance and more with pf-kernel.” – However these instructions are somewhat outdated, as it points to a non-existing source for the relevant Debian packages. But I found the thread “pf-kernel for Ubuntu” (on thepk-kernel
forums) which mentions that Debian packages can be downloaded from forum user big_bum’s Dropbox account.Installing
pf-kernel
The machine I installed on is an old 32-bit laptop, so I started off by downloading the required
linux-headers
andlinux-image
packages into a directory on my machine called~/kernel
.(Go to the above mentioned Dropbox account to find 64 bit and/or newer versions of these packages.)
Thereafter I followed the instructions on “Get Better Linux Desktop Performance and more with pf-kernel,” and executed the following commands:
Everything seem to work smoothly, so I rebooted.
Checking If It Works
A quick inspection seems to indicate that it works, e.g. the command
uname -a
reports that I'm using thepf-kernel
:And
cat /sys/block/sda/queue/scheduler
shows that BFQ now is the current disk scheduler (for thesda
disk):Patch and install a new kernel with BFS. You have to use sepatare kernels, there is no way of using both in the same kernel image (especially to swith them on-the-fly)