[理工] 有idle的情況下 cpu utilization計算

作者: tk63991 (tk63991)   2019-12-20 12:02:19
大家好 想請問洪逸在今年的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
雖然算出來一樣但不知道意思一不一樣
以上 煩請大大們解惑 感激不盡
作者: tk63991 (tk63991)   2019-12-20 12:07:00
啊啊啊算式是(11*1)/(12+1.1)少一個括號 手機不會編輯 抱歉qq
作者: rayroyray (ray)   2019-12-20 21:35:00
題目改成11個I/o那麼第一個I/o在1.1ms做完後有12ms的operation則是12+1.1(分母)分子就是cpu使用時間(不含context switch)

Links booklink

Contact Us: admin [ a t ] ucptt.com