Translation Lookaside Buffer Flashcards

1
Q

What problems do the translation lookaside buffer deal with?

A

Translations are slow when paging.

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

Where is the Translation Lookaside Buffer located? What is its function?

A

In the MMU. It is a hardware cache of popular virtual to physical address translations.

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

What types of locality does the TLB make use of? How?

A

Spacial locality - When we load in a virtual page translation to the buffer, if we are accessing different parts of memory on this page, then we get cache hits.
Temporal locality - We are likely to get cache hits if we access the same memory multiple times.

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

How would the OS handle a TLB miss?

A

An exception will be raised, causing the process to go into kernel mode, where the OS will take over. The Trap handler will handle the translation.
Importantly, when we return from kernel mode, we must return to the instruction which caused the miss, as this instruction will now be in the cache.

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

What is it important to remember about the TLB when performing a context switch? How can we solve this problem?

A

The entries in the TLB will no longer be valid for the new context. We could solve this by either flushing the cache, or by using an “address space identifier” field to identify which process the translation works for.

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