Linux 内核使用哪些调度算法? [英] What scheduling algorithms does Linux kernel use?
问题描述
Linux 内核使用什么调度算法?
What scheduling algorithms does Linux kernel use?
我在哪里可以获得有关 linux 内核的更多信息?(操作系统第一门课程...学生级别)
Where can I get more info about linux's kernel? (OS first course... student level)
推荐答案
注意: 正如 Abdullah Shahin 所说,这个答案是关于 IO 队列调度程序,而不是进程.
Note: As Abdullah Shahin noted, this answer is about IO queing scheduler, not for processes.
如果您只想检查您的 linux 系统正在使用什么调度程序以及哪些可用,您可以运行以下命令:
If you just want to check what scheduler your linux system is using and which are available you can run the following command:
cat /sys/block/sda/queue/scheduler
[] 之间的那个是它目前正在使用的那个.其他的都可以.改变它:
The one between the [] is the one it's using at the moment. The other ones are available. To change it:
sudo bash -c 'echo deadline > /sys/block/sda/queue/scheduler'
但请小心将其设置回默认值,除非您知道自己在做什么和想要什么.
Be carefull to set it back to default though, unless you know what you are doing and want.
默认(至少在较新的 Ubuntu 发行版中)是 CFQ(完全公平调度):
Default (in newer Ubuntu distros at least) is CFQ (Completely Fair Scheduling):
http://en.wikipedia.org/wiki/CFQ
采访创作者 (Jens Axboe):
Interview with the creator (Jens Axboe):
http://kerneltrap.org/node/7637
这篇关于Linux 内核使用哪些调度算法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!