ECE344-Lecture17-Memory Management

ECE344-Lecture17-Memory Management - Lecture 17 Memory...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Lecture 17: Memory Management David Lie ECE344 University of Toronto
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 ECE344: Operating Systems Overview The TLB Miss Handler: – Page Fault Handler – Swap Handler Managing the Swap Area Paging issues and Performance Putting it all together. VM and OS events: Process Creation, Copy-on-Write Process Termination Context Switching Memory mapped files and shared memory Modern Paging hardware: Superpages
Background image of page 2
3 ECE344: Operating Systems Putting it all together What does virtual memory system do during key OS events? – Process Creation (fork) – Process Execution (execv) – Process Termination (exit) – Context switch
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 ECE344: Operating Systems Putting it all together (fork) Fork creates a new address space: 1. Copy Parent’s address space structure • All regions will have the same location, sizes and permissions 2. Create a new page table • Page table is a copy of the parent’s page table • This means virtual pages in child address space map to the same physical frames as parent Is there a problem with this?
Background image of page 4
5 ECE344: Operating Systems Copy-on-write Problem: – If child/parent modifies a page, then the other will see the modification since both are mapping the same physical page. No isolation between child and parent. Solution: copy-on-write (COW) – When copying an address space, mark all virtual mappings in both page tables as read-only (even if region is writeable) • Pages that should be writeable but have been made read-only are called COW pages. – When one process modifies a COW page, this will cause a TLB fault with a “read-only” type.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 ECE344: Operating Systems TLB Faults on COW pages When the TLB fault handler detects a fault on a COW page: 1. Allocate a new physical page 2. Copy the contents of the original page to the new page 3. Make page table entry in current address space point to
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 02/20/2012.

Page1 / 18

ECE344-Lecture17-Memory Management - Lecture 17 Memory...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online