作者qazwsxee (小尧)
看板Grad-ProbAsk
标题Re: [理工] [OS]-E.A.T
时间Sun Nov 29 04:44:08 2009
※ 引述《cansister (cansister)》之铭言:
: ※ 引述《yesa315 (XD)》之铭言:
: : Consider a demand-paging system with a paging disk that has an average
: : access and transfer time of 20 milliseconds.Addresses are translated
: : through a page table in main memory, with an access time of 1 microsecond
: : per memory access. Thus, each memory reference through the page
: : table takes two accesses. To improve this time, we have added an
: : associative memory that reduces access time to one memory reference,
: : if the page-table entry is in the associative memory.
: : Assume that 80 percent of the accesses are in the associative memory
: : and that, of the remaining, 10 percent (or 2 percent of the total) cause
: : page faults.What is the effective memory access time?
: : 恐龙本习题 跟95政大的考题类似 但给的答案
: : EAT = (0.8) × (1 us) + (0.1) × (2 us) + (0.1) × (5002 us)
: : = 501.2 us
: : = 0.5 ms
: : 其中 5002us 满怪的 我算的是 应该2*20 ms + 2*1 us =40002us
: : 有高手可以解释整个架构吗?
: : 谢谢!
: EAT = (0.8)*(1us) + (0.2)*(1us + (1-0.1)*(1us) + (0.1)*(20ms))
: = 0.8us + 0.2us + 0.18us + 400us
: = 401.18us
: = 0.4ms
: 想法:
: EAT = (TLB hit)+(TLB miss)
: = (1次 memory access) + (1次memory access + 资料存在时1次 + 资料不存在时)
: 读取page table资料 memory access page fault
: 这样对吗?? 我不是很确定
我觉得他题目给的答案是错的(恐龙本也不一定就是对的)
of the remaining, 10 percent (or 2 percent of the total)
=>剩下的机率 的 再10%
=>(20%) 就是 (2%)
这是其中一行题目~解答没有考虑到是2%造成page fault~机率就写错了~
以下是我的见解:
考虑1个 需求分页 系统
(1) 使用paging disk
=>发生page faults後 average (access and transfer time) = 20 milliseconds
(2) an access time of 1 microsecond per memory access. => 1us
(3) page table in main memory
=> 每次参考 需要 2次 (存取page table所在位址 + 存取实体位址)
(4) 加入一个associative memory
使得 减少存取时间of one memory reference
(5) if the page-table entry is in the associative memory.
就是使用所谓的 TLB
associative memory access time 没写 通常是省略(因为极快~近似0)
(20%机率的其中再90%可在此取得 = 18% of the total)
| (存取Main memory上的 page table所在位
| 址 + 实体位址 =1us+1us )
(其余的20%机率中) | |
| | |
| | | (其余的20%机率的再10%机率只能
(80% TLB hit) | | | 去disk取 =2% of the total)
| | | | |
↓ ↓ ↓ ↓ ↓
: (0.8)*(1us) + (0.2) * [0us + (0.9)*(2us) + (0.1)*( 1us +20ms + 0us+ 2us )]
↑ | | | | |
| ↓ | | | |
| (TLB Miss成本) | | | |
| | | | |
| | | | |
| (page Miss成本=1us)←— | | |
| | | |
(存取Main memory上实体位址=1us ) | | |
(page fault)←——————— ↓ |
:[替换完之後 还要去] ——→(TLB 再次Miss)|
[Main memory 存取 ] (因为刚放上去)|
| (所以TLB内没有)|
↓ ↓
(存取Main memory上的 page table所在位址 + 实体位址=1us+1us)
= 0.8us + 0.36us + 0.02 * 20003us
=401.22 us
欢迎讨论
--
学长学长!那边有飙车族 学长学长!那边刚好像有女生 学长学长!那边有人红灯右转
砍人 被压上车 ψQSWEET
鸽 ◥ 鸽 ◥ 鸽 ◥ 鸽 ◥ 鸽 ◥他妈的◤ 鸽
◤◎ ◎ 喔~~ ◤︶ ︶ ◤◎ ◎ 喔~~ ◤︶ ︶ ◤◎ ◎ 拦下来呀!⊙ ⊙◥
◥ ◤ ◥ █◤ ◥ ◤ ◥ 3◤╯ξ
◥ ◤没王法了◥皿 ◤
◥ ◥◥ (哈欠)◤ ◥◤ ◥ ◥◥ (烟~) ◤ ◥ ◤ ̄ ◥ ◥◥是不是?!(
◥ ◤ ◤)
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.227.112.246
※ 编辑: qazwsxee 来自: 61.227.112.246 (11/29 04:47)
※ 编辑: qazwsxee 来自: 61.227.112.246 (11/29 04:49)
1F:→ dolphin0111:最後那边应该不用算page miss吧! 12/21 18:57
2F:→ dolphin0111:好像又要 12/22 08:32
3F:→ dolphin0111:我觉得那个page miss我不太懂他的意思 12/22 08:44
4F:→ dolphin0111:感觉那个地方应该是指hit time 12/22 08:45
5F:→ dolphin0111:当搬到Cache之後再去access data 12/22 08:46
6F:推 comaniac:page Miss成本 和 存取...中略...所在位址 有什麽不同@@? 12/30 02:01
7F:→ comaniac:照理说发生page miss後不会先去存实体位置(因为miss) 12/30 02:02
8F:→ comaniac:而是去disk抓data(20ms),抓回来後才存取memory 12/30 02:02
9F:→ comaniac:所以这个动作不会做两次,有错请指教m(_ _)m 12/30 02:03
10F:推 yesa315:page miss要先查page table才能得知实体位置 12/30 10:14