Article title: BFS introduction, the Fast Future of Linux desktop ?. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
As in the past, we are still compiling the new Linux kernel, a required course for accelerating the Linux system. The encounter with Linux kernel BFS is full of coincidence. Now it seems that BFS Kernel is the biggest surprise for Linux in the past six months-the system is as powerful and passionate as a TV shopping host! And people can feel it fast! This document is specially used to compile the system, and the desktop speed is crazy about Linux control. To all Linux desktop users.
I first read the xkcd cartoon on the Kindle. some cartoons are as follows:
A: After thousands of years of hard work by some people, the latest Linux patch supports 4096 CPU computers! Only 1024 supported!
B: Why is the full-screen Flash video card not stuck?
A: card. But who is watching the video?
The message about BFS was first seen on the Linux Magazine. shortly afterwards, GG1 Android mobile ROM was changed to CM and began to use BFS as the schednel of kernel in his beta version CyanogenMod, after the trial, we found that the speed of the mobile phone system was significantly faster. Sliding the screen on the left and right by hand is as smooth as rolling pages under Opera, resulting in a lot of fingerprint printing on the screen. It has been a long time ago. it coincides with the official release of the new Linux kernel 2.6.31 version, compilation with BFS Patch, and restart. The same speed of God appeared again on my 4-year-old laptop, and KDE4 injected with chicken blood was incredibly exciting. Fast! Fast! Fast!
So what is BFS?
To know what BFS is, you 'd better first understand its author, the legendary Australian warrior CK.
CK, Con Kolivas, male, Australian middle-aged man, senior kernel hacker. As we all know, Linux Kernel is a gathering of talented and arrogant geeks, and CK seems to be the most suitable for such places. It really seems like a typical face of a man with high IQ in a movie.
A few years ago, Linux kernel was compiled, and the ck patch set is synonymous with system acceleration. At that time, the kernel compiling trilogy was the kernel source code, followed by the ck patch set, and compiled and installed. Later, the upstream code absorbed the stable part of the ck patch set, and its influence gradually disappeared.
CK itself has deep knowledge about task scheduling. he is smart and classic to achieve fair scheduling, the implementation mode was used by Igor for reference and improvement, and finally the process scheduling manager CFS (Completely Fair Scheduler) used by kernel was written ). I have to introduce task scheduling by the way. The process scheduling of Kernel mainly allocates CPU resources to various drivers and processes. You may have heard of scientific or pseudoscientific comments that average people use less than 20% of their brains. But the fact is that the CPU on your computer has never been actually used by 100% (don't tell me that you have seen CPU 100% in the resource manager, and I have seen it before ). It is a serious science to put all kinds of computing tasks into the CPU in an orderly manner, and it is never a problem that TV shopping guides can solve. The computing workload of a single plug-in is reduced, the CPU is idle, the computing time is increased, and the computer is slow. However, when the computing of a single plug-in is too much, the CPU is too busy, and the computing will be queued at the door, the computer is also slow. Process Scheduling mainly uses algorithms to solve this problem, but now the CFS used in Linux Kernel is said to be very classic, and the CPU utilization can be quite high under different circumstances. Now, CFS was added in 2.6.23, replacing O (1) and bringing Linux desktop speed from the XX age to the XX + N age.
Two years ago, CK faded out of kernel development and suddenly evaporated from the lake. A few weeks ago, CK came out of the game again. Two years ago, it brought BFS, the full name of Brain Fuck Scheduler. (if you only know the word in the middle, refer to Google Translate ), claimed to be designed for low-end hardware (I understand that computers, TV phones, and game consoles with no more than 10 CPUs are regarded as low-end computers ), to put it bluntly, it is faster than Kernel's by default. Why is BFS called this name? For Chinese users, do they not understand either of the three words? Well, this name is a bit indecent, but it's pretty straightforward. By the way, it is said that CK started to take advantage of the cartoon I mentioned above. How many people use computers with thousands of CPUs? Why sacrifice desktop performance for this scalability. BFS made a trade-off during this period. it only supports a maximum of 16 CPUs, and makes the problem outer strip smaller, making the algorithm simpler and more efficient. As a principle, this is enough to explain the source of speed. For other waste problems, CK wrote a special FAQ. In the foreseeable future, BFS will not enter the mainline kernel. to put it bluntly, it is a problem of orientation.
The key question is how to use it?
If you do not know where the kernel source code of 2.6.31 is, you don't have to go on to it. you may still be confused during the current historical period. Next: The first patch under the http://ck.kolivas.org/patches/bfs/, which is now starting with 2.6.31, indicates that this version applies. Decompress the kernel source code, install patches, and compile and install the configurations. Currently, BFS is still in the testing phase and is not completely mature, but it is quite available. What do I need to configure during compilation? No. Scheduler is too low-level. after the patch is installed, the original CFS is replaced. there is no option for you to select. If you have to ask, isn't it quick? remember to get the configuration to 1000Hz, enable preempt, and disable dynamic ticks. It's not necessary to restart the compilation. I can put an have fun in the cool way and then play the Mac. you can't start your machine and don't need to contact me. Although it is okay for me to successfully start the pure kernel single-plus BFS Patch compilation, there is still a bad luck to start it after compilation. In addition, those who were fooled by me made the same response: "fast! People can feel fast !"
Is it worth looking at? is there any assessment?
This is the final problem for some readers who are not tough enough. In principle, the lower the machine configuration, the more obvious the feeling. If you have to evaluate it, Phoronix is also a professional Linux evaluation site. I can come to the early spoiler conclusion that the difference is very small. BFS won most tests, but the advantage is not obvious. I just want to add the feelings of the vast majority of people who have struggled.
-- Fast! People can feel fast!