免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 3154 | 回复: 13
打印 上一主题 下一主题

[驱动] 进程调度 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-03-24 17:14 |只看该作者 |倒序浏览
大家好,我在看ulk中的process sheduling这一章时,看到有一个表,就是table-7.2,其中有两项不知道什么意思。
interactivedelta
sleep time threshold 是cpu从sleep状态切换回来的时间吗!
请大侠相助。

论坛徽章:
0
2 [报告]
发表于 2011-03-24 17:23 |只看该作者
还有个疑问,做linux driver在看ulk的时候,发现有好多内容都是操作系统的内容,感觉那需要看的很深吗?
我花了整整两个星期来研究mm,感觉会不会有点浪费时间。有的东西是不是应该只要了解一些概念就好了,这是我最近学习时最大的困惑。
希望大侠赐教!!!

论坛徽章:
22
丑牛
日期:2014-08-15 14:32:0015-16赛季CBA联赛之同曦
日期:2017-12-14 15:28:14黑曼巴
日期:2017-08-10 08:14:342017金鸡报晓
日期:2017-02-08 10:39:42黑曼巴
日期:2016-11-15 15:48:38CU十四周年纪念徽章
日期:2016-11-09 13:19:1015-16赛季CBA联赛之同曦
日期:2016-04-08 18:00:03平安夜徽章
日期:2015-12-26 00:06:30程序设计版块每日发帖之星
日期:2015-12-03 06:20:002015七夕节徽章
日期:2015-08-21 11:06:17IT运维版块每日发帖之星
日期:2015-08-09 06:20:002015亚冠之吉达阿赫利
日期:2015-07-03 08:39:42
3 [报告]
发表于 2011-03-24 19:05 |只看该作者
学习了总是好的,虽然忘记的快,但是基本原理懂了,以后做事碰到问题就能往更正确的方向去想。
做驱动,我感觉不需要对内核理解的很深,如果先去琢磨内核,会让自己感觉很难。
我就是先看内核再做驱动,还是必须从头开始。现在才感觉到从做驱动入手慢慢到内核的正确性。

感觉最重要的就是不要浮躁,踏踏实实学习,不要想一口吃成胖子。

论坛徽章:
22
丑牛
日期:2014-08-15 14:32:0015-16赛季CBA联赛之同曦
日期:2017-12-14 15:28:14黑曼巴
日期:2017-08-10 08:14:342017金鸡报晓
日期:2017-02-08 10:39:42黑曼巴
日期:2016-11-15 15:48:38CU十四周年纪念徽章
日期:2016-11-09 13:19:1015-16赛季CBA联赛之同曦
日期:2016-04-08 18:00:03平安夜徽章
日期:2015-12-26 00:06:30程序设计版块每日发帖之星
日期:2015-12-03 06:20:002015七夕节徽章
日期:2015-08-21 11:06:17IT运维版块每日发帖之星
日期:2015-08-09 06:20:002015亚冠之吉达阿赫利
日期:2015-07-03 08:39:42
4 [报告]
发表于 2011-03-24 19:05 |只看该作者
我也是刚学习内核,刚参加工作而已。不对之处还请高手多多指正

论坛徽章:
0
5 [报告]
发表于 2011-03-25 08:15 |只看该作者
恩,谢谢了。
但是还是没有人解决我的那个问题啊!!!

论坛徽章:
22
丑牛
日期:2014-08-15 14:32:0015-16赛季CBA联赛之同曦
日期:2017-12-14 15:28:14黑曼巴
日期:2017-08-10 08:14:342017金鸡报晓
日期:2017-02-08 10:39:42黑曼巴
日期:2016-11-15 15:48:38CU十四周年纪念徽章
日期:2016-11-09 13:19:1015-16赛季CBA联赛之同曦
日期:2016-04-08 18:00:03平安夜徽章
日期:2015-12-26 00:06:30程序设计版块每日发帖之星
日期:2015-12-03 06:20:002015七夕节徽章
日期:2015-08-21 11:06:17IT运维版块每日发帖之星
日期:2015-08-09 06:20:002015亚冠之吉达阿赫利
日期:2015-07-03 08:39:42
6 [报告]
发表于 2011-03-25 13:29 |只看该作者
你的问题,我看的是中文版,书现在不在旁边,我记得那一章用了好几个变量决定平均睡眠时间。影响调度的时间片分配的。你可以到网上看看中文版的
因为O(1)的算法已经过时了,所以我没非常认真琢磨这一章了

论坛徽章:
0
7 [报告]
发表于 2011-03-25 14:29 |只看该作者
回复 6# amarant
你说的没有错,但是那个图里面的最右边两项都没有明确的解释。
让我很不明白。

论坛徽章:
22
丑牛
日期:2014-08-15 14:32:0015-16赛季CBA联赛之同曦
日期:2017-12-14 15:28:14黑曼巴
日期:2017-08-10 08:14:342017金鸡报晓
日期:2017-02-08 10:39:42黑曼巴
日期:2016-11-15 15:48:38CU十四周年纪念徽章
日期:2016-11-09 13:19:1015-16赛季CBA联赛之同曦
日期:2016-04-08 18:00:03平安夜徽章
日期:2015-12-26 00:06:30程序设计版块每日发帖之星
日期:2015-12-03 06:20:002015七夕节徽章
日期:2015-08-21 11:06:17IT运维版块每日发帖之星
日期:2015-08-09 06:20:002015亚冠之吉达阿赫利
日期:2015-07-03 08:39:42
8 [报告]
发表于 2011-03-25 14:39 |只看该作者
回复 7# stefan_wei


    现在有点事,比较忙   有空了我回去琢磨琢磨

论坛徽章:
0
9 [报告]
发表于 2011-03-28 15:15 |只看该作者
啊,为什么还是没有人解决啊!!!
请大侠相救。

论坛徽章:
22
丑牛
日期:2014-08-15 14:32:0015-16赛季CBA联赛之同曦
日期:2017-12-14 15:28:14黑曼巴
日期:2017-08-10 08:14:342017金鸡报晓
日期:2017-02-08 10:39:42黑曼巴
日期:2016-11-15 15:48:38CU十四周年纪念徽章
日期:2016-11-09 13:19:1015-16赛季CBA联赛之同曦
日期:2016-04-08 18:00:03平安夜徽章
日期:2015-12-26 00:06:30程序设计版块每日发帖之星
日期:2015-12-03 06:20:002015七夕节徽章
日期:2015-08-21 11:06:17IT运维版块每日发帖之星
日期:2015-08-09 06:20:002015亚冠之吉达阿赫利
日期:2015-07-03 08:39:42
10 [报告]
发表于 2011-03-29 08:24 |只看该作者
本帖最后由 amarant 于 2011-03-29 08:25 编辑
The expression static priority / 4 - 28 is called the interactive delta ; some typical values of this term are listed inTable 7-2. It should be noted that it is far easier for high priority than for low priority processes to become interactive. For instance, a process having highest static priority (100) is considered interactive when its bonus value exceeds 2, that is, when its average sleep time exceeds 200 ms. Conversely, a process having lowest static priority (139) is never considered as interactive, because the bonus value is always smaller than the value 11 required to reach an interactive delta equal to 6. A process having default static priority (120) becomes interactive as soon as its average sleep time exceeds 700 ms.


這段仔細看看,interactive delt用來判斷是否是交互式進程
The average sleep time is also used by the scheduler to determine whether a given process should be considered interactive or batch. More precisely, a process is considered "interactive" if it satisfies the following formula:
dynamic priority <= 3 x static priority / 4 + 28 (3)
which is equivalent to the following:
bonus - 5 >= static priority / 4 - 28


Sleep time threshold,睡眠時間極限值
The sleep time threshold depends on the static priority of the process; some typical values are shown in Table 7-2. In short, the goal of this empirical rule is to ensure that processes that have been asleep for a long time in uninterruptible modeusually waiting for disk I/O operationsget a predefined sleep average value that is large enough to allow them to be quickly serviced, but it is also not so large to cause starvation for other processes.



BTW:這個問題到內核源碼板塊問更好,版主flw2對這個算法非常熟悉
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP