作者tk63991 (tk63991)
看板Grad-ProbAsk
标题[理工] 有idle的情况下 cpu utilization计算
时间Fri Dec 20 12:02:19 2019
大家好 想请问洪逸在今年的os讲cpu 利用率问题的时候补充了一个探讨 有点忘记上课怎麽讲的了 所以上来发问 原问题如下
[CPU Scheduling] Consider a system running ten I/O-bound tasks and one CPU-bound task. Assume that the I/O-bound tasks issue an I/O operation once for every millisecond of CPU computing and that each I/O operation takes 10 milliseconds to complete. Also assume that the context switching overhead is 0.1 milliseconds and that all processes are long-running tasks. What is the CPU utilization for a Round-robin scheduler when:
(a) The time quantum is 1 millisecond (5%)
(b) The time quantum is 10 milliseconds (5%)
探讨是说 cpu total time其实是process 执行时间+context switch time 要再加上cpu idle time
问说如果此题改为11个I/O bound task 没有cpu bound task
若每个I/O operation改为12ms , 则会有cpu idle time 1ms 想问这个1ms是怎麽来的
如果是照他画的图那样第一个process执行完之後开始I/O operation 数12秒 那这样idle time为什麽不是12-11-0.1
还有洪逸的算式是写 (11*1)/12+1.1
不太懂分母为什麽写12+1.1
我自己理解是 11*1.1+idle time 1ms
虽然算出来一样但不知道意思一不一样
以上 烦请大大们解惑 感激不尽
-----
Sent from JPTT on my Sony H8166.
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 39.13.225.75 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Grad-ProbAsk/M.1576814541.A.530.html
1F:→ tk63991: 啊啊啊算式是(11*1)/(12+1.1)少一个括号 手机不会编辑 抱 12/20 12:07
2F:→ tk63991: 歉qq 12/20 12:07
3F:→ rayroyray: 题目改成11个I/o那麽第一个I/o在1.1ms做完後有12ms的op 12/20 21:35
4F:→ rayroyray: eration则是12+1.1(分母) 12/20 21:35
5F:→ rayroyray: 分子就是cpu使用时间(不含context switch) 12/20 21:37