22. Beyond Physical Memory: Policies Flashcards

1
Q

What is AMAT? What is the formula?

A

AMAT stands for average memory access time. It is calculated as (AMAT = T + (Pm * Td), where T is cost of memory access, Pm is miss rate and Td is cost of disk access

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

How does optimal policy work? Is it used and how?

A

Replace the page that will be accessed further in the future. It’s not possible to implement it in general purpose OS so it’s only used a comparison marker.

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

What a replacement policy is compared to?

A

To an optimal policy.

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

What are three types of misses are there?

A

Compulsory (cold start) miss occurs because cache is empty. Capacity miss occurs because the cache is full and had to evict an item to bring new one in the cache. Conflict miss arises because of limits on where an item can be placed in hardware cache.

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

What are types of replacement policies are there?

A

FIFO - replace the page that came in first. Random - just evict randomly.

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

What are the two algorithms based on history and which metrics they use?

A

LFU (Least frequently used) and LRU (Least recently used). They are based on frequency and recency of pages.

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

What bit does LRU use for approximating? What approximating and not keeping all data to make a certain decision?

A

Use (or referrence) bit. Keeping all data is costly to navigate through.

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

How exactly is referrence bit used for approximating?

A

With a clock algorithm. When a replacement must occur, OS checks if the currently pointed page (with clock hand) has a referrence bit set to 0. If no, it clears the bit (sets from 1 to 0) and proceeds to next page. If it has 0, it evicts this page.

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

What is dirty bit and why is it used?

A

It’s a bit that specifies whether the page was modified while in memory. Evicting a dirty page is costly because requires writing it back to disk. While clean pages can be evicted for free since they are unchanged.

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

What technique can be used to optimize writing pages to disk?

A

Clusterring or groupping of pages.

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

What are other policies employed by VM subsystem?

A

Page selection policy (on demand, prefetching) and policy that determines how OS writes pages back to disk (clustering, grouping).

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

What property of a program improves cache hit rate?

A

Locality (spatial and temporal)

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

What is downside of LRU type algorithms?

A

We need to track the access to pages and update some data structure each time, which can decrease performance

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

What is the other policy used beside the page replacement policy?

A

Page selection policy (when to bring a page in memory). For most pages, OS uses demand paging (bring in page when it’s needed).
Also the writing to disk policy (grouping, clustering)

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

What is other technique different from demand paging?

A

Prefetching (guessing that a page is about to be used and fetching it)

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