- 浏览: 1477192 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (691)
- linux (207)
- shell (33)
- java (42)
- 其他 (22)
- javascript (33)
- cloud (16)
- python (33)
- c (48)
- sql (12)
- 工具 (6)
- 缓存 (16)
- ubuntu (7)
- perl (3)
- lua (2)
- 超级有用 (2)
- 服务器 (2)
- mac (22)
- nginx (34)
- php (2)
- 内核 (2)
- gdb (13)
- ICTCLAS (2)
- mac android (0)
- unix (1)
- android (1)
- vim (1)
- epoll (1)
- ios (21)
- mysql (3)
- systemtap (1)
- 算法 (2)
- 汇编 (2)
- arm (3)
- 我的数据结构 (8)
- websocket (12)
- hadoop (5)
- thrift (2)
- hbase (1)
- graphviz (1)
- redis (1)
- raspberry (2)
- qemu (31)
- opencv (4)
- socket (1)
- opengl (1)
- ibeacons (1)
- emacs (6)
- openstack (24)
- docker (1)
- webrtc (11)
- angularjs (2)
- neutron (23)
- jslinux (18)
- 网络 (13)
- tap (9)
- tensorflow (8)
- nlu (4)
- asm.js (5)
- sip (3)
- xl2tp (5)
- conda (1)
- emscripten (6)
- ffmpeg (10)
- srt (1)
- wasm (5)
- bert (3)
- kaldi (4)
- 知识图谱 (1)
最新评论
-
wahahachuang8:
我喜欢代码简洁易读,服务稳定的推送服务,前段时间研究了一下go ...
websocket的helloworld -
q114687576:
http://www.blue-zero.com/WebSoc ...
websocket的helloworld -
zhaoyanzimm:
感谢您的分享,给我提供了很大的帮助,在使用过程中发现了一个问题 ...
nginx的helloworld模块的helloworld -
haoningabc:
leebyte 写道太NB了,期待早日用上Killinux!么 ...
qemu+emacs+gdb调试内核 -
leebyte:
太NB了,期待早日用上Killinux!
qemu+emacs+gdb调试内核
http://lwn.net/Articles/224865/
CPU scheduling seems to be one of those eternally unfinished jobs. Developers can work on the CPU scheduler for a while and make it work better, but there will always be workloads which are not served as well as users would like. Users of interactive systems, in particular, tend to be sensitive to scheduler latencies. In response, the current scheduler has grown an elaborate array of heuristics which attempt to detect which processes are truly interactive and give them priority in the CPU. The result is complicated code - and people still complain about interactive response.
Enter Con Kolivas, who has been working on improving interactivity for some time. His latest proposal is the Rotating Staircase Deadline Scheduler (RSDL), which attempts to provide good interactive response with a relatively simple design, complete fairness, and bounded latency. This work takes ideas from Con's earlier staircase scheduler (covered here in June, 2004), but with a significantly different approach.
Like many schedulers, the RSDL maintains a priority array, as is crudely diagrammed to the left. At each level there is a list of processes currently wanting to run at that priority; each process has a quota of time it is allowed to execute at that priority. The processes at the highest priority are given time slices, and the scheduler rotates through them using a typical round-robin algorithm.
When a process uses its quota at a given priority level, it is dropped down to the next priority and given a new quota. That process can thus continue to run, but only after the higher-priority processes have had their turn. As processes move down the staircase, they increasingly must contend with the lower-priority processes which have been patiently waiting on the lower levels. The end result is that even the lowest-priority processes get at least a little CPU time eventually.
An interesting feature of this scheduler is that each priority level has a quota of its own. Once the highest priority level has used its quota, all processes running at that level are pushed down to the next-lower level, regardless of whether they have consumed their individual CPU time quotas or not. As a result of this "minor rotation" mechanism, processes waiting at lower priority levels need only cool their heels for a bounded period of time before all other processes are running at their level. The maximum latency for any process waiting to run is thus bounded, and can be calculated; there is no starvation with this scheduler.
As processes use up their time, they are moved to a second array, called the "expired" array; there they are placed back at their original priority. Processes in the expired array do not run; they are left out in the cold until no more processes remain in the currently active array - or until all processes are pushed off the bottom of the active array as a result of minor rotations. At that point, a "major rotation" happens: the active and expired arrays are switched and the whole series of events restarts from the beginning.
The current scheduler tries to locate interactive tasks by tracking how often each process sleeps; those seen to be interactive are then rewarded with a priority boost. The RSDL does away with all that. Instead, processes which sleep simply do not use all of their time at the higher priority levels. When they run, they are naturally advantaged over their CPU-hungry competition. If a process sleeps through a major rotation, its quota goes back into the run queue's priority-specific quota value. Thus, it will be able to run at high priority even if other high-priority processes, which have been running during this time, have been pushed to lower priorities through minor rotations. All of this should add up to quick response from interactive applications.
A few benchmarks posted by Con show that systems running with RSDL perform slightly better than with the stock 2.6.20 scheduler. The initial reports from testers have been positive, with one person urging that RSDL go into 2.6.21. That will not happen at this point in the release cycle, but Linus is favorable to including RSDL in a future kernel:
I agree, partly because it's obviously been getting rave reviews so far, but mainly because it looks like you can think about behaviour a lot better, something that was always very hard with the interactivity boosters with process state history.
Con has recently been heard to complain about difficulties getting his interactivity improvements into the mainline. This time around, however, he may find the course of events to be rather more gratifying.
CPU scheduling seems to be one of those eternally unfinished jobs. Developers can work on the CPU scheduler for a while and make it work better, but there will always be workloads which are not served as well as users would like. Users of interactive systems, in particular, tend to be sensitive to scheduler latencies. In response, the current scheduler has grown an elaborate array of heuristics which attempt to detect which processes are truly interactive and give them priority in the CPU. The result is complicated code - and people still complain about interactive response.
Enter Con Kolivas, who has been working on improving interactivity for some time. His latest proposal is the Rotating Staircase Deadline Scheduler (RSDL), which attempts to provide good interactive response with a relatively simple design, complete fairness, and bounded latency. This work takes ideas from Con's earlier staircase scheduler (covered here in June, 2004), but with a significantly different approach.
Like many schedulers, the RSDL maintains a priority array, as is crudely diagrammed to the left. At each level there is a list of processes currently wanting to run at that priority; each process has a quota of time it is allowed to execute at that priority. The processes at the highest priority are given time slices, and the scheduler rotates through them using a typical round-robin algorithm.
When a process uses its quota at a given priority level, it is dropped down to the next priority and given a new quota. That process can thus continue to run, but only after the higher-priority processes have had their turn. As processes move down the staircase, they increasingly must contend with the lower-priority processes which have been patiently waiting on the lower levels. The end result is that even the lowest-priority processes get at least a little CPU time eventually.
An interesting feature of this scheduler is that each priority level has a quota of its own. Once the highest priority level has used its quota, all processes running at that level are pushed down to the next-lower level, regardless of whether they have consumed their individual CPU time quotas or not. As a result of this "minor rotation" mechanism, processes waiting at lower priority levels need only cool their heels for a bounded period of time before all other processes are running at their level. The maximum latency for any process waiting to run is thus bounded, and can be calculated; there is no starvation with this scheduler.
As processes use up their time, they are moved to a second array, called the "expired" array; there they are placed back at their original priority. Processes in the expired array do not run; they are left out in the cold until no more processes remain in the currently active array - or until all processes are pushed off the bottom of the active array as a result of minor rotations. At that point, a "major rotation" happens: the active and expired arrays are switched and the whole series of events restarts from the beginning.
The current scheduler tries to locate interactive tasks by tracking how often each process sleeps; those seen to be interactive are then rewarded with a priority boost. The RSDL does away with all that. Instead, processes which sleep simply do not use all of their time at the higher priority levels. When they run, they are naturally advantaged over their CPU-hungry competition. If a process sleeps through a major rotation, its quota goes back into the run queue's priority-specific quota value. Thus, it will be able to run at high priority even if other high-priority processes, which have been running during this time, have been pushed to lower priorities through minor rotations. All of this should add up to quick response from interactive applications.
A few benchmarks posted by Con show that systems running with RSDL perform slightly better than with the stock 2.6.20 scheduler. The initial reports from testers have been positive, with one person urging that RSDL go into 2.6.21. That will not happen at this point in the release cycle, but Linus is favorable to including RSDL in a future kernel:
I agree, partly because it's obviously been getting rave reviews so far, but mainly because it looks like you can think about behaviour a lot better, something that was always very hard with the interactivity boosters with process state history.
Con has recently been heard to complain about difficulties getting his interactivity improvements into the mainline. This time around, however, he may find the course of events to be rather more gratifying.
发表评论
-
xl2tp 备份
2019-09-24 16:25 6922019年9月24日更新: 注意,需要开启firewall ... -
sdl笔记
2019-01-31 17:19 732sdl教程教程 https://github.com/Twin ... -
tinyemu
2019-01-24 17:59 1432参考https://bellard.org/jslinux/t ... -
aws搭建xl2tp给iphone使用
2018-12-26 21:37 18922019年12月26日 可以参考原来的配置 https:// ... -
consul的基本使用
2017-06-27 11:13 1399### 安装 [centos7上consul的安装](ht ... -
lvs的helloworld
2017-06-13 20:36 596###################lvs######### ... -
系统调用的helloworld
2017-05-04 16:14 632《2.6内核标准教程》 p293 #include < ... -
bitcoin和cgminer的安装
2017-04-05 22:45 1958参考 http://blog.csdn.net/rion_ch ... -
ceph安装和常用命令
2017-03-21 21:55 953/etc/hosts ssh-keygen ssh-copy- ... -
mobile terminal 笔记
2016-12-02 15:35 624找出旧的iphone4 越狱之后可以变个小操作系统 mobi ... -
socket基础和select(python)
2016-06-14 17:21 1801上接 c语言的socket基础ht ... -
socket基础(c语言)
2016-06-14 16:45 994不使用select 普通的基础socket连接,对多个客户端的 ... -
ffmpeg+nginx 的直播(2,直播摄像头和麦克风)
2016-05-28 20:21 4358假设我的服务器是centos7 192.168.139.117 ... -
ffmpeg+nginx 的直播(1,直播播放的视频文件)
2016-05-26 17:11 659264位操作系统centos7 ############ 1.一 ... -
socat和netcat(nc)
2016-04-29 22:36 1744转 原文链接: http://www.wenquan.name ... -
neutron基础九(qemu nat网络)
2016-02-06 17:21 1621接上基础八,kvm透传nested忽略 1.在主机ce ... -
neutron基础八(qemu 桥接网络)
2016-02-06 13:13 1542qemu的桥接和nat的qemu启动命令是一样的,但是后续的脚 ... -
neutron基础七(qemu tap)
2016-02-02 17:02 1030使用qemu 建立个虚拟机 然后用tap设备, 根据基础六,t ... -
neutron基础六(bridge fdb)
2016-01-28 18:30 2263转发表 在三台机器上建立三个namespace 192.16 ... -
南北流量
2016-01-23 23:26 1824一、三层网络架构: 接入层:负责服务器的接入和隔离 汇聚层:汇 ...
相关推荐
根据给定的信息,我们可以深入探讨进程优先级调度算法的相关知识点。 ### 进程优先级调度算法概述 在操作系统中,进程调度是一项核心功能,它决定了系统如何分配处理器资源给各个进程。优先级调度算法是一种常用的...
设计一个按优先数调度的程序,需要考虑如何合理地分配和更新优先级,以及如何处理优先级反转和优先级继承等问题,以确保系统的公平性和响应性。 其次,时间片轮转法是一种面向短进程和交互式任务的调度策略。系统将...
本主题将深入探讨CPU调度算法的实现,特别是时间片调度算法和优先级调度算法。 时间片调度算法,也称为轮转调度,是将所有就绪进程按一定顺序放入一个队列中,然后为每个进程分配一个固定的时间片(如10毫秒或100...
6. **优先级反转和死锁预防**:在优先级调度中,需要考虑优先级反转(低优先级进程持有高优先级进程所需的资源)和死锁(多个进程互相等待对方释放资源)的问题。可以通过优先级继承或资源预分配等策略来解决。 在...
操作系统中的调度算法是管理CPU执行任务的关键部分,它决定了如何有效地分配处理器资源。本文将详细介绍两种常见的调度算法——轮转调度(Round Robin Scheduling, RR)和优先级调度(Priority Scheduling),并结合...
最后,我们关注“安全性算法”和“银行家算法”,它们是用于内存管理的重要策略。安全性算法检查系统当前状态是否有可能在不引起死锁的情况下满足所有进程的资源需求。如果可以,系统是安全的;否则,需要采取预防...
驱动调度电梯算法是一种在操作系统中用于管理磁盘I/O操作的策略,它的主要目标是高效地安排磁盘读写请求,以最小化磁头移动时间,从而提高整体系统性能。在给定的描述中,提到的"pcbIO"可能是"进程控制块IO"的简称,...
多级反馈队列调度算法(Multilevel Feedback Queue Scheduling,MLFQ)是一种在操作系统中用于进程调度的策略,其目标是优化系统的整体性能,兼顾各种类型的任务,确保响应时间和吞吐量的平衡。该算法的核心思想是将...
本资料“作业调度算法.rar”着重探讨了四种常见的作业调度算法,包括抢占式和非抢占式策略,以及它们在实际操作中的应用。以下是这些算法的详细说明: 1. 非抢占式算法: - 先来先服务(FCFS,First-Come First-...
根据给定的信息,本文将详细解释如何在C语言中实现三种磁盘调度算法:先来先服务(FCFS)、最短寻道优先(SSTF)以及电梯算法(SCAN)。这些算法是操作系统中的核心概念之一,用于管理磁盘读写请求的处理顺序,从而...
最后,为了评估算法性能,可以记录并分析各种性能指标,如平均等待时间、周转时间、带权周转时间和系统吞吐量。 通过这个实验,你可以深入理解各种CPU调度算法的原理,了解它们对系统性能的影响,并且提升C++编程...
在分析和实现过程中,我们还可以考虑其他因素,例如抢占(即正在运行的低优先级进程被更高优先级进程中断)和优先级反转(可能导致优先级高的进程被优先级低的进程阻塞),这些复杂的调度问题在实际操作系统中是常见...
根据提供的信息,我们可以深入探讨计算机操作系统中的电梯调度算法这一主题。该题目主要涉及的是操作系统中的磁盘调度算法,其中电梯算法是最为常见的方法之一。在理解这部分内容时,我们需要掌握以下几个核心概念:...
调度算法在操作系统中扮演着至关重要的角色,它决定了进程如何在处理器上执行,从而影响到系统的性能、响应时间和吞吐量。本实验报告将深入探讨调度算法的原理与实践。 一、调度算法概述 调度算法的主要任务是决定...
8. **调度开销**:调度过程本身也需要占用处理器时间,因此设计算法时需要平衡调度效率和调度开销。优化算法以减少不必要的上下文切换,有助于提高系统性能。 总之,按优先数调度算法是实现处理器调度的一种有效...
本文将深入探讨“非抢占式优先级进程调度算法”,并结合`main.c`源代码进行详细阐述。 首先,我们要理解什么是进程调度。在多任务环境下,操作系统必须管理多个并发运行的进程,确保每个进程都能公平地获取计算资源...
在这个“进程调度模拟实验”中,我们将深入探讨三种基本的调度算法:先来先服务(FCFS)、基于高优先级的调度以及短作业优先(SJF)调度算法。 **一、先来先服务调度算法(FCFS)** FCFS调度算法是最简单的调度策略...
优先级调度需要注意防止低优先级进程永远等待(优先级反转)和高优先级进程长时间占用CPU(优先级继承)的问题。 6. **多级反馈队列(MLFQ,Multi-Level Feedback Queue)**:结合了多种调度策略,设置多个队列,每...
本主题将深入探讨五种常见的进程调度算法:优先级调度、最短进程算法(Shortest Process Next, SPN)、最短剩余时间算法(Shortest Remaining Time First, SRTF)、先来先服务(First-Come, First-Served, FCFS)...
在操作系统中,调度算法是决定如何分配处理器资源的关键机制,主要目标是提高系统效率和响应时间。本篇文章将深入分析三种常见的调度算法:先来先服务(FCFS)、最高优先权优先(HPF)和时间片轮转(RR),并对它们...