欢迎来到天天文库
浏览记录
ID:51506454
大小:405.83 KB
页数:32页
时间:2020-03-25
《中科大操作系统原理与实现课件9_VirtualMemory1.pdf》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、操作系统原理与设计第9章VM1(虚存1)陈香兰中国科学技术大学计算机学院2009年09月01日......提纲BackgroundDemandPagingBasicConcepts(HWsupport)PerformanceofDemandPagingCopy-on-Write小结和作业......BackgroundII指令必须被装载到内存中运行I前面的解决方案IToplacetheentirelogicaladdressinphysicalmemoryIOverlays(覆盖)IDynamicloadingIDynamiclinkingI然而I有时
2、候作业很大;有时候作业个数很多I若从物理上扩展内存,代价太高I思路:从逻辑上扩展内存......BackgroundIII虚存技术的引入I程序的有些部分根本得不到或者只有很少的运行的机会,例如某些错误处理程序I有些数据根本得不到访问的机会I程序的局部性原理(localityofreference),1968,DenningI时间局部性、空间局部性I思路:部分装入、按需装入、置换I虚拟存储器:是指具有请求调度功能和置换功能,能从逻辑上对内存容量加以扩充的一种存储器系统I逻辑容量:从系统角度看:内存容量+外存容量从进程角度看:地址总线宽度范围内;内存容量+
3、外存容量I运行速度:接近内存I每位成本:接近外存......BackgroundIIIIVirtualmemory:separationofuserlogicalmemoryfromphysicalmemory.IOnlypartoftheprogramneedstobeinmemoryforexecutionILogicaladdressspacecanthereforebemuchlargerthanphysicaladdressspaceIAllowsaddressspacestobesharedbyseveralprocessesIAllows
4、formoreefficientprocesscreationIVirtualmemorycanbeimplementedvia:IDemandpagingI以分页技术为基础,加上I请求调页(pager)功能和页面置换功能I与对换相比,页面置换中换入换出的基本单位是页,而不是整个进程IDemandsegmentation......VirtualMemoryThatisLargerThanPhysicalMemory......虚拟存储器的特征I多次性:最重要的特征I一个作业被分成多次装入内存运行I对换性I允许在进程运行的过程中,(部分)换入换出I虚拟性
5、I逻辑上的扩充I虚拟性是以多次性和对换性为基础的。I多次性和对换性是建立在离散分配的基础上的......Virtual-addressSpaceIthevirtualaddressspaceofaprocessreferstothelogical(orvirtual)viewofhowaprocessisstoredinmemory.ITypically:0˜xxx&existsincontiguousmemoryIInfact,thephysicalmemoryareorganized(partitioned)inpageframes&thepage
6、framesassignedtoaprocessmaynotbecontiguous)MMU......Somebenifits1.SharedLibraryUsingVirtualMemory2.Sharedmemory3.speedingupprocesscreation......DemandPagingIDonotloadtheentireprograminphysicalmemoryatprogramexecutiontime.NONEED!IBringapageintomemoryonlywhenitisneededILessI/Oneede
7、dILessmemoryneededIFasterresponseIMoreusersIPageisneeded)referencetoitIinvalidreference)abortInot-in-memory)bringtomemoryISwapperVS.pagerIAswappermanipulatestheentireprocessesILazyswapperneverswapsapageintomemoryunlesspagewillbeneededISwapperthatdealswithindividualpagesisapager.
8、.....TransferofaPagedMemorytoContiguousDiskSpac
此文档下载收益归作者所有