虛擬記憶體
Virtual Address 會 mapping 到 physical address,當中透過 MMU 元件進行轉換。
分類
- Demand Paging
- Demand Segmentation
Demand Paging
Demand Segmentation
Linux Virtual Memory
- Page Directory
- Page Table
- Page Table Entry (PTE)
linux page fault
- MAJFL: major fault
- MINFL: minor fault
| 功能領域 | Intel x86_64 | ARM (AArch64) | RISC-V |
|---|---|---|---|
| 系統規範文件 | Volume 3A/3B | Arm ARM (DDI 0487) | Privileged Architecture |
| 特權階層 | Ring 0 (Kernel) / Ring 3 (User) | EL1 (Kernel) / EL0 (User) | S-mode (Kernel) / U-mode (User) |
| 頁表/MMU | 4/5-Level Paging (CR3) | VMSA (TTBR0/1_EL1) | Sv39 / Sv48 / Sv57 (satp) |
| 中斷控制器 | Local APIC + IOAPIC | GIC (IHI 0069) | PLIC / APLIC / AIA |
| 系統呼叫指令 | SYSCALL / SYSRET | SVC / ERET | ECALL / SRET |
參考連結(References)
架構與特權規範
- Intel® 64 and IA-32 SDM — 系統程式設計指南在 Volume 3A–3D(合併卷 PDF)
- 5-Level Paging and 5-Level EPT White Paper — x86_64 五級頁表
- Arm® Architecture Reference Manual for A-profile (DDI 0487) — VMSA、Exception Level
- Arm® Generic Interrupt Controller Architecture Specification (IHI 0069) — GICv3/v4
- RISC-V Ratified Specifications Library — 含 Volume II: Privileged Architecture(Sv39/48/57)
- RISC-V Advanced Interrupt Architecture (AIA) — APLIC / IMSIC
虛擬記憶體與 Linux 核心
- Linux Kernel Memory Management (developer docs) — 頁表、page fault 內部機制
- Linux Admin Guide: Memory Management — THP、hugetlbfs 等調校
- Understanding the Linux Virtual Memory Manager — Mel Gorman, 2004(Linux 2.4/2.6)
- getrusage(2) —
ru_majflt/ru_minflt - proc(5) —
/proc/[pid]/stat的majflt/minflt - ps(1) —
MAJFL/MINFL欄位
Operating System