What is the difference between cfs and bfs kernel




















Improve this answer. Luis Alvarado Luis Alvarado k gold badges silver badges bronze badges. So in summary The BFS scheduler is probably better for desktop computing? Well, as the linked pdf says : "it is dicult to provide a single CPU scheduler that performs well in all platforms and use cases. Like Maxime said. At least the most common usages must be studied further and tested a lot to determined the best suited scheduler. For the time being the work for this to come is under way. Sign up or log in Sign up using Google.

Sign up using Facebook. Sign up using Email and Password. Workload Schedulers - Genesis, Algorithms and Comparisons. Highly Influenced. View 3 excerpts, cites background, results and methods. View 1 excerpt, cites methods. View 2 excerpts, cites background and methods. Addressing the feasibility of USI-based threads scheduler on polymorphic computing system. View 4 excerpts, cites methods. But a dish that can be accepted by everyone may mean a little bland. BFS only intends to satisfy one taste in order to develop this taste to the limit.

The thing stems from some Linux users who found that although Linux claims to be able to give full play to the computing power of the CPU system, it cannot play Youtube videos smoothly on an ordinary laptop.

This makes people start to think, for the Desktop environment, which complex features of CFS are still meaningful? Is it necessary for people to use a scheduler that supports CPUs in their personal computers? BFS is the natural response to this challenge.

In addition, BFS also removes features that are only needed on the server. In addition, BFS uses a single run queue and no longer requires a complex load balancing mechanism. These simple cuts have greatly simplified the BFS code. The simplified code means that the number of instructions required to perform a scheduling is reduced, and the corresponding footprint is naturally reduced.

Of course, simplifying the code is only an obvious aspect. More importantly, the difference in this concept will have a more profound impact on the final scheduler implementation, which is really difficult to describe.

When the Linux kernel entered 2. In a multi-CPU system, a single run queue means that the run queue becomes the bottleneck of the system, because at the same time, when a CPU accesses the run queue, other CPUs must wait even if they are idle.

After using the per CPU run queue, each CPU no longer needs to use a large lock, so that it can process scheduling in parallel. Kolivas found that the benefits of using per cpu run queue will be offset by the load balance code that pursues fairness. This load balance process requires obtaining locks from other run queues.

This operation reduces the parallelism caused by multiple run queues. And in complex situations, this kind of footprint introduced by load balance will be very impressive. Of course, the lock operation introduced by load balance is still lower than the cost of global locks. This difference in cost is more significant as the number of CPUs increases. If the number of CPUs in the system is limited, the advantage of multiple run queues is not obvious.

After BFS uses a single queue, each new process that needs to be scheduled can find the most suitable CPU in the global scope, without the need for CFS to wait for the load balance code to decide, which reduces the delay of the decision between multiple CPUs The result is a smaller scheduling delay.

Kolivas has been paying attention to the performance of Linux on the desktop for many years. For desktop users, the most important thing is not the throughput of the system, but the smooth experience of interactive programs.

Starting from SD, Kolivas told kernel hackers that complete fairness can fundamentally guarantee interactivity. He always insists on a basic point: the scheduler should look forward only. Never consider the past of a process. CFS has to consider the past of the process. Soon after, when 2. Therefore, in the kernel after 2.

This strategy is very subtle, and we detailed the evolution of sleeper fairness in Section 2. If you take some time to look back, you will find out how serious delay problems caused by sleeper fairness. Although Ingo claims that Gentle fairness solves the delay problem, from the code point of view, Gentle Fairness only halves the reward for sleeper.

So we can say that CFS still rewards the Sleeper process, which represents a preference and an "unfair". This is exactly what BFS opposes. In BFS, when a process wakeup, the scheduler will choose according to the process's deadline this article will describe in detail in Chapter 4 , the result is that the process that sleeps earlier can be scheduled faster; CFS The sleeper fairness means that the next scheduled process should be selected according to the wakeup time, and the earlier wakeup process will be scheduled faster.

There is no theoretical basis for the impact of this difference on desktop applications. But I personally think that BFS's strategy is more reasonable. You may have read a little irritable now what do these English and Chinese say , so I will introduce the implementation details of BFS as soon as possible.

Then maybe you will understand me, some words are better not translated. The scheduler is a very complex topic, especially the CFS scheduler. If you want to describe it clearly, you need an extraordinary pen, which I have not found. First introduce a few key concepts. When a process is created, it is given a fixed time slice, and a virtual Deadline. The calculation formula of this virtual deadline is very simple:. Get 2GB of online storage for free. Sign up for Dropbox now! As stated latency is usually reduced, and random stalls should be reduced.



0コメント

  • 1000 / 1000