L21 - Virtual Memory ECS 154B Computer Architecture II...

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

View Full Document Right Arrow Icon
1 ECS 154B Computer Architecture II Winter 2008 Virtual Memory and Memory Hierarchy 7.4-7.5 Adapted from slides by Mary Jane Irwin, Penn State 2 Virtual Memory • Uses main memory as a “cache” – Provides paging for the program – Allows memory protection – Enables code relocation • What makes it work? Locality • Two address spaces – Virtual addresses known to program – Physical addresses used to access memory 3 Paging • Virtual memory allows a process to access more memory than is actually present through paging – Pages currently used by a process are located in main memory – When main memory becomes full, some pages are written to disk • The swap space on disk holds pages temporarily • When accessed again the pages are moved from the swap space to main memory – The Page Table tracks each page’s location • A limited memory may cause thrashing – Pages frequently swapped between memory and disk – Decreases performance drastically 4 Page Replacement • What page is written to disk when memory becomes full? – LRU used most often • Reference bit in the TLB/Page Table set when a page is referenced by the process • OS periodically reads and clears the Reference bits and tracks page usage – Extra overhead for true LRU acceptable because of large access latency for secondary memory
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 5 Virtual Memory Writes • What happens on writes? – Write back used for pages in memory • Secondary memory very slow • Large page size means it is highly likely page will be referenced again • Large block transfers to secondary memory better than small (few word) transfers – Include dirty bit in TLB and page table • Set when the process writes to the page • When the pages is removed from memory, it is only written if the dirty bit is set 6 Relocation • Virtual memory allows the OS to move a process anywhere in memory – Process only knows the virtual address
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

L21 - Virtual Memory ECS 154B Computer Architecture II...

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

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