操作系统Chapter06-2(New).ppt

  1. 1、本文档共71页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
操作系统Chapter06-2(New)

6.6 系统举例 Linux存储管理 Windows2000/XP存储管理 6.6.1 Linux存储管理 Physical memory-management Three level page table Buddy algorithm for managing memory pages(frames) Virtual Memory management Demand paging no pre-paging, no working set. Page replacement page daemon: kswapd, runs once a second , keep enough free pages in memory. flush daemon: bdflush, wakes up periodically, “dirty page out”. Managing Physical Memory Allocate ranges of physically-contiguous pages on request. The allocator uses a buddy-heap algorithm to keep track of available physical pages. Each allocatable memory region is paired with an adjacent partner. Whenever two allocated partner regions are both freed up they are combined to form a larger region. If a memory request cannot be satisfied by allocating an existing small free region, then a larger free region will be subdivided into two partners to satisfy the request. Memory allocations time statically: drivers reserve at boot time dynamically (via page allocator). Buddy heap存储分配 64 32 32 32 16 16 8 8 32 16 8 8 req(8) req(8) req(4) rel(8) 32 8 4 4 16 4 rel(8) 32 16 8 8 8 32 8 8 8 32 4 4 8 8 8 8 8 4 4 32 8 Buddy Heap Implementation 9(29) 8(28) 7(27) 6(26) 5(25) 4(24) 3(23) 2(22) 1(21) 0(20) 4 512 256 空闲页面分成10个块组: 编号i=0~9 第i组: 中记载长度为2i 个页面的连续区域. 表示从第256号页面开始, 连续有28=256个页面的块组. 128 64 48 24 8 6.6.2 Windows 2000/XP Memory Management 存储管理 虚拟存储管理器(Virtual Memory Manager :VMM) 负责存储管理 核心: 6 Threads 进程地址空间: 32bits地址=4GB 2GB用户空间,2GB系统空间. PDE PTE Byte 31 22 21 12 11 0 页目录入口 页表入口 页内位移 6.6.2 Windows 2000/XP Memory Management 每页4KB; 地址32位=4B; 1页表=1024项; 进程空间:512个页表;系统空间512个页表; PDE PTE Byte …… …… CR3 + + + 页目录 页表 6.6.2 Windows 2000/XP Memory Management 页面调度 三种状态: 闲置(free)、预定(Reserved)、确认(Committed); 闲置:不存在页面; 确认:已经在内存; 预定:保留内存用; 6.6.2 Windows 2000/XP Memory Management 0 1 …… 511 512 …… k …… 1023 0 1 …… n 0 1 …… 511 512 …… n …… 1023 P2页目录 P1页目录 原型页表 系统页表 P

文档评论(0)

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

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

1亿VIP精品文档

相关文档