看板 Grad-ProbAsk 關於我們 聯絡資訊
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
darren0831: 那個page fault的時間應該多乘了p 12/24 21:57
darren0831: page fault發生後要額外花時間去disk抓正確資料直接 12/24 22:01
darren0831: page fault發生的比例乘以所需要的時間 12/24 22:01
Transfat: 不用先去確認TLB miss 再去算page fault ratio? 還是因 12/24 22:04
Transfat: 為他講"total" page fault ratio 12/24 22:04
yupog2003: 嗯嗯,total page fault ratio指的應該就是global miss 12/24 22:05
Transfat: 感謝你>< 12/24 22:07
yupog2003: 我的算式:1*(1+20)+0.001*20+0.00001*2000000=41.02 12/24 22:07
yupog2003: 我習慣全用global miss rate下去看,每個人習慣不同 12/24 22:08
darren0831: 我跟y一樣 恐龍跟洪逸都這樣算 12/24 22:09
yupog2003: 另外2000000感覺應該不用再加21,因為讀到page table的 12/24 22:09
yupog2003: 時候就知道page fault了,當時就沒有讀第二次memory 12/24 22:10
yupog2003: 從disk抓完資料到memory才會執行第二次memory access 12/24 22:11
darren0831: 感覺原PO想太多了 12/24 22:11
yupog2003: 但是這點我沒有非常確定,因為常常被四捨五入掉我也不 12/24 22:11
yupog2003: 知道我的觀念是否正確 12/24 22:12
darren0831: 恩 想想還是要加21耶Orz 12/24 22:24
darren0831: 因為題目只有給DISK相關的時間 page table 跟TLB的 12/24 22:25
darren0831: 時間應該也要算在處理page fault上面 12/24 22:25
Transfat: 我想到我以前也用y大的方式算過,可是剛剛又突然忘記觀 12/24 22:26
Transfat: 念了QQ 12/24 22:26
yupog2003: 嗯嗯,那我再回去想想,我先確認我自己的一個觀念 12/24 22:26
yupog2003: 如果page fault發生:TLB+page table+disk+memory 12/24 22:26
yupog2003: 這個流程是正確的嗎? 12/24 22:27
darren0831: 其實我一直有個疑問張凡CPU去查TLB跟page table是同 12/24 22:29
darren0831: 時的,但恐龍的公式卻是分開的XD 12/24 22:29
darren0831: 回Y大根據筆記是這樣沒錯 12/24 22:29
yupog2003: 是上課說的嗎?我在書上找不到有同時的地方,看到比較 12/24 22:35
yupog2003: 有關的在下冊75頁,可是感覺他是TLB miss才去查table的 12/24 22:36
yupog2003: 阿對拉,應該還是要加,因為disk在傳輸的時候cpu可能會 12/24 22:38
yupog2003: 去做其他工作,等disk傳輸完之後全部都要重來 12/24 22:38
yupog2003: 感謝d大釋疑XD 12/24 22:39
darren0831: 因為我有紀錄他上課說的話 課本我也沒印象有特別表 12/24 22:40
darren0831: 示 12/24 22:40
aa06697: 請問 「TLB miss,要花一次TLB access time.(do nothing)+ 12/25 00:52
aa06697: 2次memory access time」這邊 為什麼不用再乘page hit ra 12/25 00:52
aa06697: tio? 12/25 00:52
aa06697: 為什麼是直接用TLB miss的rate(0.001) 而不是用total pag 12/25 01:21
aa06697: e hit rate(1 - total page fault = 0.99999) @@~~~ 12/25 01:21
aa06697: 不是應該是分成 TLB hit / TLB miss but page hit / TLB 12/25 01:24
aa06697: miss and page fault 這樣嗎~? 中間那段應該不能只看TL 12/25 01:24
aa06697: B miss的ratio吧qq 12/25 01:24
aa06697: 沒事....別理我XDDDD 12/25 02:26