[CSE] . COMP3231/9201/3891/9283 Operating Systems 2009/S1 [UNSW]

Tutorial Week 9

Questions and Answers

Virtual Memory

Q1: What is Paging?

Paging is where main memory is divided into equal-sized chunks (frames) and the programs address space (virtual address space) is also divided up into matching-sized chunks (pages). Memory is transfered to and from disk in units of pages.


Q2: Why do all virtual memory system page sizes have to be a power of 2? Draw a picture.

The lower bits of a virtual address is not translated and passed through the MMU to form a physical address.


Q3: What is a TLB? What is its function?

A translation lookaside buffer is an associative cache of page table entries used to speed up the translation of virtual addresses to physical addresses.


Q4: Given a two-level page table (in physical memory), what is the average number of physical memory accesses per virtual memory access in the case where the TLB has a 100% miss ratio, and the case of a 95% hit ratio

3

1 * .95 + .05 * (1 + 2) = 1.1


Q5: What are the two broad categories of events causing page faults? What other event might cause page faults?

Illegal memory references and access to non-resident pages.

Page faults may be used to set reference and dirty bits on architectures that do not support them in hardware.


Q6: Of the two page table types covered in lectures, which one is most appropriate for a virtual address spaces that are sparsely populated (e.g. many single pages scattered through memory)?

The 2-level suffers from internal fragmentation. The IPT is best as it is searched via a hash, and not based on the structure of the virtual address space.


Q7: What is temporal and spatial locality?

Temporal locality: states that recently accessed items are likely to be accessed in the near future.

Spatial locality: says that items whose addresses are near one another tend to be referenced close together in time.



Page last modified: 10:57am on Monday, 11th of May, 2009

Print Version

CRICOS Provider Number: 00098G