CS439: Principles of Computer Systems
Homework 6
(Source: Alison Norman.)
Due: Wednesday, March 20, 2013, 11:59 PM Homeworks
will be submitted electronically. Please refer to
the homework turnin instructions.
-
What is a virtual address? What is a physical address? How do they
relate to each other?
- Consider a paging system with 16 pages and a page size of 256
bytes. The system has 1024 bytes of physical memory.
- How many bits are in a physical address?
- How many bits represent the page number?
- How many bits are in the complete virtual address?
- What size are the page frames?
-
What are the causes of page faults? What are the possible effects on the running process?
-
Assuming the kernel and hardware are implemented properly, does every
illegal memory reference by a process result in an exception (aka fault)?
- Belady's anomaly: Intuitively, it seems that the more frames the
memory has, the fewer page faults a program will get.
Surprisingly enough, this is not always true. Belady (1969)
discovered an example in which FIFO page replacement causes more
faults with four page frames than with three. This strange
situation has become known as Belady's anomaly. To illustrate, a
program with five virtual pages numbered from 0 to 4 references
its pages in the order:
0 1 2 3 0 1 4 0 1 2 3 4
-
Using FIFO replacement, compute the number of page faults with
3 frames. Repeat for 4 frames.
-
Compute the number of page faults under LRU, the clock
algorithm, and the optimal algorithm. What do you notice?
|