Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Spring 2013
Dan C. Marinescu
Office: HEC 304
Office hours: M-Wd 11:30 - 12:30 AM
Last time:
Today:
Virtual memory
Next time
1/22/16
Virtual memory
Several strategies
Paging
Segmentation
Paging+ segmentation
At the time a process/thread is created the system creates a page table for
it; an entry in the page table contains
The location in the swap area of the page
The address in main memory where the page resides if the page has
been brought in from the disk
Other information e.g. dirty bit.
Page fault a process/thread references an address in a page which is not
in main memory
On demand paging a page is brought in the main memory from the swap
area on the disk when the process/thread references an address in that
page.
Lecture 22
Lecture 22
Lecture 22
Lecture 22
Multi-level memories
Lecture 22
Lecture 22
Lecture 22
Lecture 22
10
11
Hit ratio h the probability that a reference will be satisfied by the primary device.
Average Latency (AS) AS = h x LP + (1-h) LS.
Example:
Hit ratio h= 0.90 AS= 0.9 x 10 + 0.1 x 10,000,000 = 1,000,000.009 nsec~ 1000
microseconds = 1 msec
Hit ratio h= 0.99 AS= 0.99 x 10 + 0.01 x 10,000,000 = 100,000.0099 nsec~ 100
microseconds = 0.1 msec
Hit ratio h= 0.999 AS= 0.999 x 10 + 0.001 x 10,000,000 = 10,000.0099 nsec~ 10
microseconds = 0.01 msec
Hit ratio h= 0.9999 AS= 0.999 0x 10 + 0.001 x 10,000,000 = 1,009.99 nsec~ 1
microsecond
This considerable slowdown is due to the very large discrepancy (six orders of
magnitude) between the primary and the secondary device.
Lecture 22
12
The size SizeP << SizeS SizeS =K x SizeP with K large (1/K small)
AverageLat ency
Size P
Size S
1
1
LP
LS
LP
LS LS
Size P Size S
Size P Size S
1 K
11/ K
Lecture 22
13
4.
On demand bring the cell to the primary device from the secondary device
when it is needed. E.g., demand paging
Anticipatory. E.g. pre-paging
Lecture 22
14