[理工] [os] 94清大

看板Grad-ProbAsk作者 (まけない!)時間15年前 (2011/01/07 19:25), 編輯推噓2(206)
留言8則, 2人參與, 最新討論串1/1
A computer whose processes have 1024 pages in their address spaces keeps it's page tables in memory. The overhead reading aword from the page table is 500ns . In order to reduce the overhead, the computer has a TLB, which holds 32 (virtual page,physical page frame)pairs, and can do a look up in 100ns. What hit rate is needed to reduce the mean overhead to 200ns? 個人的想法是: 設P為TLB的hit rate 如果TLB hit 存取時間100+500=600ns 如果TLB miss 存取TLB的時間加上存取一次page table加上一次memory的時間 100+500+500=1100ns P*600+(1-P)*1100=200 可是參考書的答案是 P*100+(1-P)*600=200 我哪裡想錯了?? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 122.116.13.191

01/07 19:32, , 1F
照我的方法一定錯 解出來P>1
01/07 19:32, 1F

01/07 19:32, , 2F
我不懂為什麼你TLB的hit time要加上page table的時間
01/07 19:32, 2F

01/07 19:33, , 3F
TLB如果hit 就不需要對page table作存取了吧
01/07 19:33, 3F

01/07 19:34, , 4F
不是TLB hit 還要到MEMORY去抓資料嗎?
01/07 19:34, 4F

01/07 19:35, , 5F
我以為題目說的page table存取時間當作memory存取時間
01/07 19:35, 5F

01/07 19:36, , 6F
應該是因為overhead吧 存取資料時的額外付出
01/07 19:36, 6F

01/07 19:37, , 7F
如果是這樣的話 我想就不需要考慮讀取資料的時間
01/07 19:37, 7F

01/07 19:38, , 8F
我懂了 謝謝<(_ _)>
01/07 19:38, 8F
文章代碼(AID): #1D9lWqS9 (Grad-ProbAsk)