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?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
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 simplest way to install BFS in Ubuntu 10.10 is a PPA patch:
sudo add-apt-repository ppa:chogydan/ppa sudo apt-get update sudo apt-get install linux-image-generic-ck linux-headers-generic-ck
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.
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.
The below worked for me on Precise Pangolin (Ubuntu 12.04) YMMV, though.
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:
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 the
pk-kernel forums) which mentions that Debian packages can be downloaded from forum user big_bum’s Dropbox account.
The machine I installed on is an old 32-bit laptop, so I started off by downloading the required
linux-image packages into a directory on my machine called
(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:
$ cd ~/kernel $ sudo dpkg -i *.deb
Everything seem to work smoothly, so I rebooted.
A quick inspection seems to indicate that it works, e.g. the command
uname -a reports that I'm using the
Linux siobhan 3.12.2-pf+ #6 SMP PREEMPT Mon Dec 2 19:09:52 EET 2013 i686 i686 i386 GNU/Linux
cat /sys/block/sda/queue/scheduler shows that BFQ now is the current disk scheduler (for the
noop deadline cfq [bfq]