作者yad50968 (boringday)
看板Grad-ProbAsk
標題[理工] OS paging
時間Thu Dec 3 11:56:47 2015
有三題需要大家幫幫忙
1.
Please answer the following question about memory management:
a.
Consider a two-level page table sceme, in which the outer page table itself is
also paged with the page table store in memory. if a memory reference takes 90ns
,how long does a paged memory reference take?
b.
If we add TLBs ,and 95 percent of all page-table references are found in the TLBs,
what is the effective memory reference time?(Assume that finding a page-table
entry in the TLBs take 9ns , if the entry is there) 98政大
ans a. 270ns b. 107.55ns
第一題沒錯
但我算不出第二題的答案
數字總是差一點點
2.
Consider the following hardware configuration. Virtual address = 32 bits,page size =
4kbytes, and a page table entry occupies 4 bytes. How many pages should the OS
allocate for the pages tables of a 12Mbyte process under the following paging mechanisms?
a. one-level paging
b. two-levle paging(Assuming that the number of entries in a first-level page
table is the same as that in a second-level page table)
ans a. 3pages b.4pages
一個page 4kb 應該要很多page 才能到達12mb吧?
請問答案是不是有錯呢
謝謝
3.
Assume that virtual address is 16 bits wide and physical address is 20 bits wide.
The page size is 4kbytes .If the mapping is done by paging ,how many entries are
there is the page table and how many bits does each entry occupy?
ans 16entries. 8bits/entry
不知道為什麼page table entry裡面是8bit
是因為只存放 實體位置的前面部分嗎?
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.114.87.231
※ 文章網址: https://www.ptt.cc/bbs/Grad-ProbAsk/M.1449115010.A.697.html
→ jerry031181: 按照他的說法 他把TLB miss的那個TLB access time 12/03 12:36
→ jerry031181: 沒有算進去 式子變成: 12/03 12:37
→ jerry031181: 0.95*(90+9)ns+0.05*270ns=95-0.95+13.5=107.55 12/03 12:38
→ jerry031181: 2. 12MB/3kB=3k個page 一個page entry佔4B 所以需要 12/03 12:41
→ jerry031181: 3k*4b的大小 =3k*4b/4k=3個page 12/03 12:42
→ jerry031181: 2 level外層需在1個page指向內層的3個page 所以4個 12/03 12:43
推 jerry031181: 1和3題我覺得怪怪的 應該TLB miss還是要算access tim 12/03 12:47
→ jerry031181: 吧 3的話 照常理也要加入管理資訊的bits吧QQ 12/03 12:48
→ yad50968: 好的!謝謝! 12/03 13:18
推 odanaga: 1.的話題目有提示說 if the entry is there 12/03 13:26
→ yad50968: 第二題的部分 12MB/3kb=3k個page 這邊的page是指什麼 12/03 13:26
→ yad50968: 因為不太懂為什麼最後變成3個page 謝謝~~ 12/03 13:26
→ odanaga: 就是再說TLB hit才算9ns TLB miss不算 ㄐㄅ 12/03 13:27
→ yad50968: 還是我沒有搞清楚他在問什麼@@? 12/03 13:31
→ odanaga: 2.說for the pages tables , 大概是問PT個數吧 (大概) 12/03 13:35
→ yad50968: 所以是在問pt的數量 話說 pt 跟 page 大小一樣嗎 12/03 13:55
→ odanaga: 這題看起來是這樣 12/03 14:11
→ jerry031181: Allocate 12MB的MEMory需要3k個page才能塞啊 12/03 15:07
→ jerry031181: 1個page又需要4byte來記錄 所以至少要記錄4b*3k的 12/03 15:08
→ jerry031181: Page資訊 因為mem中已page為儲存方式 所以12kb的 12/03 15:09
→ jerry031181: Page資訊就至少需要用3個page儲存 12/03 15:09
→ jerry031181: 第二題是問pt需要用幾個page儲存啦~ 12/03 15:14
→ yad50968: OK! thank u! 12/03 15:50