The hierarchical constant bandwidth server scheduler

The POSIX realtime model, which is implemented in the Linux kernel, can ensure that a realtime process obtains the CPU time it needs to get its job done. It can be less effective, though, when there are multiple realtime processes competing for the available CPU resources. The hierarchical constant bandwidth server patch series, posted by Yuri Andriaccio with work by Luca Abeni, Alessio Balsini, and Andrea Parri, is a modification to the Linux scheduler intended to make it possible to configure systems with multiple realtime tasks in a deterministic and correct manner.

Linux 内核实现了 POSIX 实时模型,它可以确保实时进程获得完成任务所需的 CPU 时间。然而,当多个实时进程争夺有限的 CPU 资源时,这种模型的效果会大打折扣。为此,Yuri Andriaccio 提交了一系列“分层恒定带宽服务器(hierarchical constant bandwidth server,CBS)”补丁,该系列由 Luca Abeni、Alessio Balsini 和 Andrea Parri 参与开发,旨在修改 Linux 调度器,从而使系统可以以确定性和正确的方式配置多个实时任务。

The core concept behind POSIX realtime is priority — the highest-priority task always runs. If there are multiple processes at the same priority, the result depends on whether they are configured as SCHED_FIFO tasks (in which case the running task gets the CPU until it voluntarily gives it up) or as SCHED_RR (causing the equal-priority tasks to share the CPU in time slices). This model allows a single realtime task to monopolize a CPU indefinitely, perhaps at the expense of other realtime tasks that also need to run.

POSIX 实时模型的核心概念是优先级 —— 优先级最高的任务总是优先运行。如果有多个进程拥有相同的优先级,调度行为取决于它们是配置为 SCHED_FIFO(此时任务会一直运行直到主动放弃 CPU),还是 SCHED_RR(相同优先级的任务轮流按时间片运行)。在这种模型下,一个实时任务可以无限期地垄断 CPU,这可能会损害其他也需要运行的实时任务的利益。

In an attempt to improve support for systems with multiple realtime tasks, the realtime group scheduling feature was added to the 2.6.25 kernel in 2008 by Peter Zijlstra. It allows a system administrator to put realtime tasks into control groups, then to limit the amount of CPU time available to each group. This feature works and is used, but it has never been seen as an optimal solution. It is easy to misconfigure (the documentation warns that "fiddling with these settings can result in an unstable system"), complicates the scheduler in a number of way

你可能感兴趣的:(Linux,kernel,网络,服务器,linux,kernel,安全)