0% found this document useful (0 votes)
2 views

lecture_slides_09_092-indirection

The document discusses virtual memory (VM) and its role in solving problems related to memory management, protection, and address translation. It emphasizes the concept of indirection, which allows referencing memory through names or containers rather than direct values, facilitating flexible memory management for multiple processes. The document highlights the distinction between physical and virtual addressing, illustrating how modern systems utilize virtual memory to optimize performance and resource allocation.

Uploaded by

yihuangece
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

lecture_slides_09_092-indirection

The document discusses virtual memory (VM) and its role in solving problems related to memory management, protection, and address translation. It emphasizes the concept of indirection, which allows referencing memory through names or containers rather than direct values, facilitating flexible memory management for multiple processes. The document highlights the distinction between physical and virtual addressing, illustrating how modern systems utilize virtual memory to optimize performance and resource allocation.

Uploaded by

yihuangece
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

University of Washington

Section 9: Virtual Memory (VM)


 Overview and motivation
 Indirection
 VM as a tool for caching
 Memory management/protection and address translation
 Virtual memory example

Indirection
University of Washington

How would you solve those problems?


 Fitting a huge memory into a tiny physical memory
 Managing the memory spaces of multiple processes
 Protecting processing from stepping on each other’s memory
 Allowing processes to share common parts of memory

Indirection
University of Washington

Indirection
 “Any problem in computer science can be solved by
adding another level of indirection”

Name
 Without Indirection Thing

 With Indirection Name


Thing

Thing

Indirection
University of Washington

Indirection
 Indirection: the ability to reference something using a name, reference, or
container instead the value itself. A flexible mapping between a name
and a thing allows changing the thing without notifying holders of the
name.
Name
Thing
 Without Indirection

Name
Thing
 With Indirection
Thing

 Examples:
Domain Name Service (DNS) name->IP address, phone system (e.g., cell
phone number portability), snail mail (e.g., mail forwarding), 911 (routed
to local office), DHCP, call centers that route calls to available operators,
etc. Indirection
University of Washington

Solution: Level Of Indirection


Virtual memory

Process 1
Physical memory

mapping
Virtual memory

Process n

 Each process gets its own private virtual address space


 Solves the previous problems
Indirection
University of Washington

Address Spaces
 Virtual address space: Set of N = 2n virtual addresses
{0, 1, 2, 3, …, N-1}

 Physical address space: Set of M = 2m physical addresses (n > m)


{0, 1, 2, 3, …, M-1}

 Every byte in main memory:


one physical address; zero, one, or more virtual addresses

Indirection
University of Washington

Mapping

Physical
Memory
Virtual Address

A virtual address can be


mapped to either
physical memory or disk.

Disk

Indirection
University of Washington

A System Using Physical Addressing


Main memory
0:
1:
2:
Physical address
(PA)
3:
CPU 4:
5:
6:
7:
8:

...
M-1:

Data word

 Used in “simple” systems like embedded microcontrollers in


devices like cars, elevators, and digital picture frames
Indirection
University of Washington

A System Using Virtual Addressing


Main memory
0:
CPU Chip 1:
2:
Virtual address Physical address
(VA) (PA)
3:
CPU MMU 4:
5:
6:
7:
8:

...
M-1:

Data word

 Used in all modern desktops, laptops, servers


 One of the great ideas in computer science
Indirection

You might also like