What are BFS and CFS?
June 4, 2010
A couple of weeks ago I was browsing the XDA Developers forums looking at custom kernels for my Nexus One. I came across a kernel that looked good, however I was a bit confused about the two different versions on offer. One was called BFS and the other CFS. At the time I must have been having a bit of a blonde moment as the two acronyms completely passed me by…..
BFS and CFS are both different types of task schedulers used by the Linux kernel. CFS (Completely Fair Scheduler) is the default scheduler in the majority of distributions, however it isn’t though to be great. I won’t go into the details, however being relatively old it has built up quite a lot of bulk and the algorithms used are rather complicated.
BFS (Brain Fuck Scheduler) is the new kid on the block. It was written in 2007 after the author became annoyed with the random stalls experienced while using a Linux-based desktop machine. The scheduler is designed to offer low latency when used interactively, for example on a desktop machine, or a phone!
Always have your stuff when you need it. Automatically sync photos between your PC and Android phone. Get 2GB of online storage for free. Sign up for Dropbox now!
As stated latency is usually reduced, and random stalls should be reduced. However BFS also has another trick up its sleeve. In benchmarks it performed 80% better when encoding a video in x264 format!
BFS however isn’t (yet) going to make your Linux based systems super fast. Benchmark results are rather mixed, and discussions around it are rather heated. It is not currently included in the mainline Linux tree, and doesn’t look likely to be included anytime soon.
Either way, if you want to try it on your Android device, it is a quick flash away. Cyanogen Mod includes it by default, and there are plenty of different kernels out there you can try. Go ahead and try it, YMMV!
Further reading
- BFS – The Brain Fuck Scheduler by Con Kolivas – An introduction by the author
- FAQS about BFS – More details
- Open source collaboration done right – Thoughts of a codec developer on BFS