Chapter 7: Virtual Memory Flashcards

1
Q

Virtual Memory (VM)

A

a collection of one or more logical address spaces, each of which may exceed the size of physical memory. A logical address is then referred to as a virtual address. A paged VM creates a single large contiguous address space per process. A paged VM with segmentation creates multiple large address spaces per process, each of which is paged.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Demanding Page

A

The principle of loading a page into memory only when the page is needed, rather than at the start of execution.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Present Bit

A

A binary flag in each page table entry that indicates whether the corresponding page is currently resident in memory. If a page is resident, then the entry points to the frame that holds the page.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Page Fault

A

An interrupt that occurs when a program attempts to reference a non-resident page. The interrupt triggers the operating system to find the page on disk, copy the page into a frame, and set the present bit to 1.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Page Replacement

A

The act of overwriting a page in memory with a different page loaded from the disk when needed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Modified-Bit (m-bit)

A

A binary flag in each page table entry that indicates whether the corresponding page has been modified during execution. The modified bit is set to 1 automatically by any instruction that stores data into the page and is used by the operating system to minimize the movement of data to disk.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

reference string

A

the sequence of page numbers referenced by an executing program during a given time interval. Reference strings are used to compare different page replacement algorithms by counting the number of page faults generated.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

optimal page replacement algorithm

A

selects the page that will not be referenced for the longest time in the future

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

FIFO page replacement algorithm

A

Selects the page that has been resident in memory for the longest time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

least-recently-used page replacement algorithm (LRU)

A

Selects the page that has not been referenced for the longest time.

Implementation:

  • Whenever a resident page p is referenced, p is moved to the end of the queue. Thus the queue is always sorted from most recently used page to least recently used page.
  • When a non-resident page p is referenced, p is moved to the end of the queue and the least recently referenced page q at the head of the queue is removed. Page p then replaces q in memory.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

referenced bit (r-bit)

A

A bit associated with a page that is set automatically by the hardware whenever the page is referenced by any instruction.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

aging register

A

Associated with a page and is shifted periodically to the right by 1 bit. Unless the most significant bit is 1, the page is aging in the sense that the associated register value is steadily decreasing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

aging page replacement algorithm

A

does not maintain exact LRU order, but groups together pages referenced during a period of d consecutive references.

  1. Shift all aging registers to the right by 1, discarding the least significant bit.
  2. Copy the r-bits into the most significant bits of the aging registers.
  3. Reset all r-bits to 0.

when a page fault occurs:

  • Select the page with the smallest aging register value for replacement.
  • If multiple pages have the same smallest value then select one at random.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

second-chance page replacement algorithm

A

a coarse-grain approximation of LRU. The algorithm uses the r-bit to divide all pages into only two categories: recently referenced and not recently referenced. A page is selected from the not-recently referenced category.

At a page fault, the algorithm repeats the following steps until a page is selected for replacement:

  1. If the pointer is at a page p with r = 0 then select p and advance the pointer to the next page.
  2. Otherwise, reset r to 0, advance the pointer to the next page, and continue the search.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

third-chance page replacement algorithm
or
not-recently-used page replacement algorithm (NRU)

A

a coarse-grain approximation of LRU, which divides pages into 4 categories based on the 4 possible combination of the r-bit and the m-bit

  1. If the pointer is at a page p with r = 0 and m = 0 then select p and advance the pointer to the next page.
  2. Otherwise, reset the bits according to the following table, advance the pointer to the next page, and continue the search.

11 01 |
01 00 | modified page
———-|—————–
10 00 | unmodified page

How well did you know this?
1
Not at all
2
3
4
5
Perfectly