16-vm-concepts

physical address space dram n1 pp 6 virtual

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: izes) > main memory size )   Thrashing: Performance meltdown where pages are moved (copied) in and out con2nuously 21 Carnegie Mellon Today           Address spaces (1) VM as a tool for caching (2) VM as a tool for memory management (3) VM as a tool for memory protec;on Address transla;on 22 Carnegie Mellon (2) VM as a Tool for Memory Management   Key idea: each process has its own virtual address space   It can view memory as a simple linear array   Mapping func2on scaners addresses through physical memory   Well chosen mappings simplify memory alloca2on and management Virtual Address Space for Process 1: 0 VP 1 VP 2 Address translaIon 0 PP 2 ... Physical Address Space (DRAM) N ­1 PP 6 Virtual Address Space for Process 2: 0 PP 8 VP 1 VP 2 ... ... N ­1 (e.g., read ­only library code) M ­1 23 Carnegie Mellon Simplifying alloca;on and sharing   Memory alloca;on   Each virtual page can be mapped to any physical page   A virtual page can be stored in different physical pages at different 2mes   Sharing code and data among processes   Map mul2ple virtual pages to the same physical page (here: PP 6) Virtual Address Space for Process 1: 0 VP 1 VP 2 Address translaIon 0 PP 2 ... Physical Address Space (DRAM) N ­1 PP 6 Virtual Address Space for Process 2: 0 PP 8 VP 1 VP 2 ... ... N ­1 (e.g., read ­only library code) M ­1 24 Carnegie Mellon Simplifying Linking and Loading Kernel virtual memory   Linking 0xc0000000   Each program has similar virtual User stack (created at run;me) address space   Code, stack, and shared libraries always start at the same address Memory invisible to user code %esp (stack pointer) Memory ­mapped region for shared libraries 0x40000000   Loading   execve() allocates virtual pages for .text and .data sec2ons = creates PTEs marked as invalid Run ­;me heap (created by malloc)   The .text and .data sec2ons Read/write segment (.data, .bss) are copied, page by page, on demand by the virtual memory system Read ­only segment (.init, .text, .rodata) 0x08048000 0 brk Loaded from the executable file...
View Full Document

Ask a homework question - tutors are online