操作系统 内存管理.ppt

  1. 1、本文档共95页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
作业 什么是内部碎片;什么是外部碎片 画出最基本的分页地址变换机构。 分页和分段的主要区别是什么? 页表存放在内存中 访问一个逻辑地址中的内容需要两次访问内存 第一次:页表项,进而转换成物理地址 第二次:对应物理地址中的内容 速度:CPU vs. 2倍访存 解决方案:高速缓存(块表,TLB) Translation Lookaside Buffer 基本的地址变换机构 Page table is kept in main memory, Table Base Register (PTBR) Points to the page table currently used table length register (PRLR) Indicates size of the page table Context switch + 3 b Effective memory-access time, time needed for every data/instruction access 需要2次访存 Access the page table Access the data/instruction Solution: A special fast-lookup hardware cache called associative registers or translation look-aside buffers (TLBs) 联想存储器,快表 Associative registers Each register : a key a value Parallel search (high speed) Expensive, typically 8~2048 entries Address translation (A′, A′′) If A′ is in associative register, get frame # out. Otherwise get frame # from page table in memory 联想存储器,快表 TLB miss(TLB缺失) If the page number is not in the associative registers Get store Hit ratio(命中率) The percentage of times that a page number is found in the associative registers Context switch ? TLB flushed TLB replacement algorithm 具有块表的地址变换机构 + Effective Access Time 有效存取时间 设: Associative Lookup = ? time unit; memory cycle time = t time unit; Hit ratio = ? Effective Access Time (EAT) EAT = (t + ?) ? + (2t + ?)(1 – ?) = 2t + ? – t? If ?(20 ns), t(100 ns), ?1(80%), ?2(98%): TLB hit: 20+100=120 ns TLB miss: 20+100+100=220 ns EAT1 = 120*0.8 + 220 * 0.2 = 140 ns EAT2 = 120*0.98 + 220 * 0.02 = 122 ns 思考 从页表中读取数据的时间开销是5ns,从块表中读取数据的开销则是1ns,为使平均开销降为1ns,则块表的命中率至少为多少? Memory Protection 内存保护 If page size 2n, page frame is aligned at 2n, so … Memory protection implemented by associating protection bit with each frame Provide read only, read-write, execute-only protection or… Valid-invalid “valid”: the associated page is in the process’ logical address space, and is thus a legal page. “invalid”: the page is not in the process’ logical address space. Valid/invalid bit example Address

文档评论(0)

fc86033 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档