Presentation is loading. Please wait.

Presentation is loading. Please wait.

Vivek Seshadri 15740/18740 Computer Architecture

Similar presentations


Presentation on theme: "Vivek Seshadri 15740/18740 Computer Architecture"— Presentation transcript:

1 Vivek Seshadri 15740/18740 Computer Architecture
Virtual Memory Vivek Seshadri 15740/18740 Computer Architecture

2 Readings Jacob & Mudge, “Virtual Memory in Contemporary Microprocessors,” IEEE Micro, 1998 Hennessy and Patterson, Appendix C.4-C.5

3 Why Virtual Memory? X CPU Load X Store Y Y Main Memory

4 Why Virtual Memory? Small available physical memory
Contiguous address space Portability Protection Code & data OS data and application data One application’s data from another Sharing

5 Segmentation Segment: Base address + Size + Permissions
Segments are re-locatable Can be copied from one location to another Each process is associated with a list of segments it can access

6 Virtual Memory All problems in computer science can be
solved by another level of indirection - David Wheeler For an application to make progress, it is sufficient that the next instruction and the data required to execute the next instruction are present in main memory.

7 Virtual Memory CPU Load X Store Y Main Memory Virtual Address Space X

8 Virtual Memory Solves It All!
Small available physical memory Large virtual address space (VAS)! Contiguous address space Data should be contiguous only in VAS Protection Different process -> Different VAS Sharing Map VAS to same location in physical memory

9 Implementation Pages Page tables Inverted page tables
Large (to reduce mapping overhead) Page tables One entry per virtual page Hierarchical (to reduce size of page tables) Inverted page tables Speeding up translations Translation Look-aside Buffers (TLB)

10 Physical Memory Management
Allocating pages Replacing pages (page fault) Swap space in disk Replacement policy LRU?

11 Virtual Memory & Caching
Virtually-Indexed Virtually-Tagged Caches Virtual Page Number Offset Cacheline Tag Index Two processes can have the same virtual address

12 Solution - 1 Physically-Indexed Physically-tagged Cache
Virtual Page Number Offset PhysicalPage Number Offset Cacheline Tag Index

13 Solution - 2 Virtually-Indexed Physically-tagged Cache
Virtual Page Number Offset Physical Page Number Offset Cacheline Tag Index

14 Two virtual pages can map to the same physical page
Synonyms Two virtual pages can map to the same physical page Virtual Page Number Offset Cacheline Tag Index


Download ppt "Vivek Seshadri 15740/18740 Computer Architecture"

Similar presentations


Ads by Google