BFS vs CFS: Some personal observations on Linux Kernel performance

Dr Android ROM

For some time now, I have stopped using the Linux kernel that comes bundled with the Ubuntu operating system and use a version that has a different approach on the matter of kernel schedulers.

“Scheduler” is a time-resource-manager (task scheduler) who determines which process and how much it employs the processor (CPU) of the computer. The official scheduler of the Linux kernel is the CFS.

In the past, I made several experiments (benchmarks) to see if I could find any noticeable difference in performance of my system by optimizing the kernel and changing the scheduler. The results of the experiments did not give me any reasonable grounds for the necessity of optimizing the Linux Kernel, let alone to change the scheduler of the kernel on modern machines.

Nevertheless I continued to use a Linux Kernel with the BFS scheduler (see my article here : [Greek] Optimizing Ubuntu Linux Kernel with BFS – BFQ ) and of course to optimize the kernel according the specs of  my machine.

But yesterday, something really unexpected happened and I saw before my eyes the huge difference in performance that can give a Linux Kernel scheduler not only to an old PC but also to a modern PC with 4GB DDR3 RAM and a Intel i7 Quad Core CPU !!


Completely Fair Schedule (CFS):

To quote Wikipedia “The Completely Fair Scheduler is the name of a task scheduler which was merged into the 2.6.23 release of the Linux kernel. It handles CPU resource allocation for executing processes, and aims to maximize overall CPU utilization while also maximizing interactive performance.”

CFS is the standard scheduler for Android. As such it is compatible with all apps and processes run in Android

Brain FUCK Scheduler (BFS):

To quote Mr. Con Kolivas, the writer of BFS “BFS is the Brain Fuck Scheduler. It was designed to be forward looking only, make the most of lower spec machines, and not scale to massive hardware. ie it is a desktop orientated scheduler, with extremely low latencies for excellent interactivity by design rather than “calculated”, with rigid fairness, nice priority distribution and extreme scalability within normal load levels.”

Google looked at BFS to use as the Android scheduler but decided that it wasn’t mature enough yet.


In this experiment I used a 1,6 GB video file (.MOV) 40 minutes long and started to render it on 720p resolution. The system had the same Uptime and same conditions. The screenshot where taken on the same percentage so that we can have a fair measurement on “estimated completion time”.

I repeated this experiment for about 10 times, keeping the same conditions and it gave me the same results.

Now this is what I got :

cfs vs bfs on rendering a videofile

As you can see with the BFS scheduler the “Job” will be completed in half of the time that CFS needs. One observation that can not be seen in a picture is that with BFS the CPU had a constant and steady 98-100% CPU utilization, in contrast with CFS the CPU utilization was dropping from time to time to 25%.

A “must read” paper for a Scientific measurements of CFS vs BFS : Scientific approach to the CFS vs BFS

What are your observations ? Do you use the BFS scheduler or the CFS ?



    1. Πράγματι… Θυμάσαι τι λέγαμε ? Ε… τώρα δικαιώθηκα τουλάχιστον για την χρήση του BFS. Απο εκεί και πέρα απο το πείραμα φαίνεται οτι το compile + optimisation σε σύγχρονα μηχανήματα δεν επιφέρει κάποιο βέλτιστο αποτέλεσμα. Αλλά η αλλαγή του scheduler επιφέρει…


  1. The result looks a little unexpected to me. What was the exact protocol (process) you used for this benchmark?

    E.g., did you reboot or at least drop caches between the runs?

    It is also possible that you uncovered a locking bug somewhere in kdenlive, brought to light by CFS. Perhaps it would be useful to get to the bottom of this.

    Did you post this test to LKML?


    1. I am not sure if they (lkml) “support” custom and optimized kernel bug reports. 🙂

      My initial intentions were just to render a video file, not to benchmark the kernel. But out of curiosity I rebooted to my main BFS kernel (I have several installed for testing purposes) and did the rendering again… that moment was a hit!!! I rebooted several times, switching from CFS doing the test and then again to BFS. Did this approximately 10 times and got the same results!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s