Chapter 10 Virtual Memory

Chapter 10 Virtual Memory

Background

alt text
alt text
alt text
alt text

如果能執行部分載入的程式,會帶來什麼好處?

alt text
alt text
alt text
alt text

虛擬記憶體:邏輯與物理記憶體的分離

alt text
alt text
alt text

虛擬記憶體的實現方式

alt text
alt text
alt text
alt text

虛擬記憶體大於物理記憶體

alt text

虛擬地址空間 (Virtual Address Space, VAS) 的稀疏性

alt text
alt text
alt text
alt text

共享library

alt text

Demand Paging

alt text
alt text
alt text
alt text

  • Transferring Pages between Memory and Disk

    alt text

  • Not-in-Memory Pages

    alt text

處理頁面錯誤的步驟

alt text
alt text
alt text
alt text
alt text

頁面錯誤處理的詳細步驟

alt text
alt text
alt text
alt text
alt text
alt text
alt text

需求分頁的效能

alt text
alt text
alt text

  • Example

    alt text

需求分頁的各個面向

alt text
alt text
alt text

Copy-on-Write

alt text
alt text
alt text

vFork

alt text
alt text
alt text

Copy-on-Write

alt text
alt text
alt text
alt text

Page Replacement

alt text
alt text
alt text

alt text

基本的頁面置換流程

alt text
alt text
alt text
alt text

  • 用dirty bit 紀錄被改動過的page 這種才需要寫回磁碟

    alt text

FIFO 頁面置換示例

alt text
alt text
alt text

  • anomaly

    alt text

堆疊演算法

alt text
alt text
alt text

最佳頁面置換算法 (Optimal Page Replacement)

alt text
alt text
alt text

LRU (Least Recently Used) 最近最少使用

alt text
alt text
alt text

基於計時器的 LRU 實現

alt text
alt text
alt text

基於堆疊的 LRU 實現

alt text
alt text
alt text

LRU 實現的效能問題與解決方案

alt text
alt text
alt text

LRU 近似算法:參考位算法

alt text
alt text
alt text

LRU 近似算法:額外的參考位算法

alt text
alt text

LRU 近似算法:第二次機會算法(時鐘算法)

alt text
alt text
alt text
alt text

增強型第二次機會算法

alt text
alt text
alt text

計數型算法

alt text
alt text
alt text
alt text

頁面緩衝算法

alt text
alt text
alt text

alt text
alt text

Allocation of Frames

頁框分配

alt text
alt text
alt text

頁框分配:超越最小需求的分配策略

alt text
alt text

全域置換 vs. 局部置換

alt text
alt text
alt text

Thrashing

抖動 (Thrashing)

alt text
alt text
alt text

局部性

alt text
alt text
alt text
alt text

工作集模型

alt text
alt text
alt text

工作集模型圖解與實作

alt text
alt text
alt text

頁面錯誤頻率方案

alt text
alt text

Memory-Mapped Files

Allocation Kernel Memory

Other Considerations

Operating System Examples


Chapter 10 Virtual Memory
https://z-hwa.github.io/webHome/[object Object]/Operation Systems/Chapter-10-Virtual-Memory/
作者
crown tako
發布於
2025年1月9日
許可協議