VM Address Translation - Speeding up Address Translation, Address Translation with a TLB Notes

: VM Address Translation - Speeding up Address Translation, Address Translation with a TLB Notes

 Page 1


1
How is a Block Found if it is in VM –
Address Translation
• How does this address translation from virtual to 
physical take place?
• A table is created (Page Table) that maps all the 
virtual page numbers to physical page numbers
– It has an entry for every virtual page that exists on the 
hard drive
• Note it must record all of the virtual pages even if they 
are not currently being used
– Note this can be quite large – where would we put it?
• The operating system reserves part of main memory to 
store the table
Slide 1 (Notes) 
Page 2


1
How is a Block Found if it is in VM –
Address Translation
• How does this address translation from virtual to 
physical take place?
• A table is created (Page Table) that maps all the 
virtual page numbers to physical page numbers
– It has an entry for every virtual page that exists on the 
hard drive
• Note it must record all of the virtual pages even if they 
are not currently being used
– Note this can be quite large – where would we put it?
• The operating system reserves part of main memory to 
store the table
Slide 1 (Notes) 
2
Recall Another View of the Role of the 
Page Table
page table
(physical page 
 or disk address)
Physical Memory
Disk Storage
Valid
1
1
1
1
1
1
1
0
0
0
Virtual Page
Number
Cached
Uncached
Slide 2 (Notes) 
Page 3


1
How is a Block Found if it is in VM –
Address Translation
• How does this address translation from virtual to 
physical take place?
• A table is created (Page Table) that maps all the 
virtual page numbers to physical page numbers
– It has an entry for every virtual page that exists on the 
hard drive
• Note it must record all of the virtual pages even if they 
are not currently being used
– Note this can be quite large – where would we put it?
• The operating system reserves part of main memory to 
store the table
Slide 1 (Notes) 
2
Recall Another View of the Role of the 
Page Table
page table
(physical page 
 or disk address)
Physical Memory
Disk Storage
Valid
1
1
1
1
1
1
1
0
0
0
Virtual Page
Number
Cached
Uncached
Slide 2 (Notes) 
3
Aside on the OS Management of the Page 
Table
• Have you ever gotten the message: 
“Running low on virtual memory, allocating 
more VM…”
–
Basically the OS lengthens the Page Table and 
reserves additional regions on the hard drive to 
serve as additional virtual pages
Slide 3 (Notes) 
Page 4


1
How is a Block Found if it is in VM –
Address Translation
• How does this address translation from virtual to 
physical take place?
• A table is created (Page Table) that maps all the 
virtual page numbers to physical page numbers
– It has an entry for every virtual page that exists on the 
hard drive
• Note it must record all of the virtual pages even if they 
are not currently being used
– Note this can be quite large – where would we put it?
• The operating system reserves part of main memory to 
store the table
Slide 1 (Notes) 
2
Recall Another View of the Role of the 
Page Table
page table
(physical page 
 or disk address)
Physical Memory
Disk Storage
Valid
1
1
1
1
1
1
1
0
0
0
Virtual Page
Number
Cached
Uncached
Slide 2 (Notes) 
3
Aside on the OS Management of the Page 
Table
• Have you ever gotten the message: 
“Running low on virtual memory, allocating 
more VM…”
–
Basically the OS lengthens the Page Table and 
reserves additional regions on the hard drive to 
serve as additional virtual pages
Slide 3 (Notes) 
4
VM Address Translation
• Address Translation
– The goal is to map the virtual space to the 
physical space
– For a given virtual address there are two 
cases:
1. If desired data at virtual address currently at a 
physical address in main memory
• If desired data at virtual address is not at a 
physical address in main memory – called a Page 
Fault
– Data address is either invalid or stored on disk
Slide 4 (Notes) 
Page 5


1
How is a Block Found if it is in VM –
Address Translation
• How does this address translation from virtual to 
physical take place?
• A table is created (Page Table) that maps all the 
virtual page numbers to physical page numbers
– It has an entry for every virtual page that exists on the 
hard drive
• Note it must record all of the virtual pages even if they 
are not currently being used
– Note this can be quite large – where would we put it?
• The operating system reserves part of main memory to 
store the table
Slide 1 (Notes) 
2
Recall Another View of the Role of the 
Page Table
page table
(physical page 
 or disk address)
Physical Memory
Disk Storage
Valid
1
1
1
1
1
1
1
0
0
0
Virtual Page
Number
Cached
Uncached
Slide 2 (Notes) 
3
Aside on the OS Management of the Page 
Table
• Have you ever gotten the message: 
“Running low on virtual memory, allocating 
more VM…”
–
Basically the OS lengthens the Page Table and 
reserves additional regions on the hard drive to 
serve as additional virtual pages
Slide 3 (Notes) 
4
VM Address Translation
• Address Translation
– The goal is to map the virtual space to the 
physical space
– For a given virtual address there are two 
cases:
1. If desired data at virtual address currently at a 
physical address in main memory
• If desired data at virtual address is not at a 
physical address in main memory – called a Page 
Fault
– Data address is either invalid or stored on disk
Slide 4 (Notes) 
5
Page Faults (like “Cache Misses”)
• What if an object is on disk rather than in memory?
– Page table entry indicates virtual address not in memory
– OS exception handler invoked to move data from disk into 
memory
• current process suspends, others can resume
• OS has full control over placement, etc.
CPU
Memory
Page Table
Disk
Virtual
Addresses
Physical
Addresses
CPU
Memory
Page Table
Disk
Virtual
Addresses
Physical
Addresses
Before fault After fault
Slide 5 (Notes) 
Read More
Use Code STAYHOME200 and get INR 200 additional OFF
Use Coupon Code

Download free EduRev App

Track your progress, build streaks, highlight & save important lessons and more!