[理工] 104台大電機OS 第八題
http://imgur.com/a/c6ipC
之前有人問過了,不過我還是有點不懂的地方。
我的了解EMAT(effective memory access time)= TLB hit ratio*(TLB hit time+memory
access time)+TLB miss ratio*(TLB hit time+memory access time*2)
// memeory access time*2 是因為要一次去access memory to get the page table and
frame, plus the time to access memory to get the data.
這題又加入一個backing store(secondary store), 所以我覺得總共的時間是:
假設TLB miss ratio=p%, total page fault ratio=q%, 題目給定TLB access time= 1ns,
memory access time=20ns, backing store access and transfer time = 2000000 ns,
所以EMAT= (1-p)*(1+20)+p*(1+20*2)+p*q*(1+20+2000000)
意義就是TLB hit中了,要花TLB access time+一次memory access time, 加上如果TLB miss,
要花一次TLB access time.(do nothing)+2次memory access time, 加上如果又page
fault, 要花1次TLB access time+1次memory access time+一次backing store access
time.
所以把(B)數據帶進去, p=0.001, q=0.00001
EMAT=0.999*(1+20)+0.001*(1+40)+0.001*0.00001*(2000021)=21.04, 可是答案給(B)是
對的,所以應該是我哪觀念搞錯了,請教一下大家,感謝
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.112.25.105
※ 文章網址: https://www.ptt.cc/bbs/Grad-ProbAsk/M.1482586393.A.B64.html
→
12/24 21:57, , 1F
12/24 21:57, 1F
→
12/24 22:01, , 2F
12/24 22:01, 2F
→
12/24 22:01, , 3F
12/24 22:01, 3F
→
12/24 22:04, , 4F
12/24 22:04, 4F
→
12/24 22:04, , 5F
12/24 22:04, 5F
推
12/24 22:05, , 6F
12/24 22:05, 6F
→
12/24 22:07, , 7F
12/24 22:07, 7F
→
12/24 22:07, , 8F
12/24 22:07, 8F
→
12/24 22:08, , 9F
12/24 22:08, 9F
推
12/24 22:09, , 10F
12/24 22:09, 10F
→
12/24 22:09, , 11F
12/24 22:09, 11F
→
12/24 22:10, , 12F
12/24 22:10, 12F
→
12/24 22:11, , 13F
12/24 22:11, 13F
→
12/24 22:11, , 14F
12/24 22:11, 14F
→
12/24 22:11, , 15F
12/24 22:11, 15F
→
12/24 22:12, , 16F
12/24 22:12, 16F
→
12/24 22:24, , 17F
12/24 22:24, 17F
→
12/24 22:25, , 18F
12/24 22:25, 18F
→
12/24 22:25, , 19F
12/24 22:25, 19F
→
12/24 22:26, , 20F
12/24 22:26, 20F
→
12/24 22:26, , 21F
12/24 22:26, 21F
推
12/24 22:26, , 22F
12/24 22:26, 22F
→
12/24 22:26, , 23F
12/24 22:26, 23F
→
12/24 22:27, , 24F
12/24 22:27, 24F
→
12/24 22:29, , 25F
12/24 22:29, 25F
→
12/24 22:29, , 26F
12/24 22:29, 26F
→
12/24 22:29, , 27F
12/24 22:29, 27F
→
12/24 22:35, , 28F
12/24 22:35, 28F
→
12/24 22:36, , 29F
12/24 22:36, 29F
→
12/24 22:38, , 30F
12/24 22:38, 30F
→
12/24 22:38, , 31F
12/24 22:38, 31F
→
12/24 22:39, , 32F
12/24 22:39, 32F
→
12/24 22:40, , 33F
12/24 22:40, 33F
→
12/24 22:40, , 34F
12/24 22:40, 34F
推
12/25 00:52, , 35F
12/25 00:52, 35F
→
12/25 00:52, , 36F
12/25 00:52, 36F
→
12/25 00:52, , 37F
12/25 00:52, 37F
→
12/25 01:21, , 38F
12/25 01:21, 38F
→
12/25 01:21, , 39F
12/25 01:21, 39F
→
12/25 01:24, , 40F
12/25 01:24, 40F
→
12/25 01:24, , 41F
12/25 01:24, 41F
→
12/25 01:24, , 42F
12/25 01:24, 42F
→
12/25 02:26, , 43F
12/25 02:26, 43F