
ECS 150, Operating Systems Fall Quarter 2008
Homework 3
Due Date: November 21, 2008 Points: 90
Questions
1. (10 points)Answer erroneously included on earlier version; please omit
2. (20 points) Assume that we have a paged memory system with a cache to hold the most active page table entries.
It takes 20ns to search the cache. If the page table is normally held in memory, and memory access time is 1µs,
what is the effective access time if the hit ratio is 85%? What hit ratio will be necessary to reduce the effective
memory access time to 1.1µs?
3. (30 points) Consider the following page reference string: ω=abcdabeabcd e. For the following, assume there
are no pages in memory initially.
(a) If the system uses the FIFO page replacement algorithm, with 3 frames available, how many page faults
occur?
(b) If the system uses the FIFO page replacement algorithm, with 4 frames available, how many page faults
occur?
(c) If the number of page faults differs in parts 3a and 3b, please explain the increase or decrease in the number
of page faults.
4. (20 points) Consider the reference string ω=abcdebcdcbddbd dd. Assuming the working set replacement
strategy, determine the minimum window size such that the string generates at most five page faults. Show
which pages are in memory at each reference, as well as which pages are being brought into, and removed from,
memory.
5. (20 points) A virtual memory has a page size of 1024 words, 8 virtual pages, and 4 physical page frames. The
page table is as follows:
virtual page page frame
0 3
1 1
2 not in main memory
3 not in main memory
4 2
5 not in main memory
6 0
7 not in main memory
(a) Which virtual addresses will cause page faults?
(b) What are the physical addresses for 0, 3728, 1023, 1024, 1025, 7800, and 4096?
Extra Credit
1. (20 points) Consider a memory in which contiguous segments S1,..., Snare placed strictly in their order of
creation from one end of the store to the other. That is, when segment Sn+1is being created, it is placed
immediately after segment Sneven though some of the segments S1,..., Snmay have already been deleted.
When the boundary between segments (in use or deleted) and the hole reaches the other end of the store, the
segments in use are compacted. Let sand tdenote the average length and lifetime of a segment (measured in
words and memory references). Let fdenote the fraction of the memory which is unused under equilibrium
conditions. Show that the fraction of time Fspent on compacting is constrained by F≥1f
1+k f , where k=t
2s−1.
Hint: Find the average speed at which the boundary crosses the memory and assume that copying of a single
word requires at least two memory references.
Version of November 12, 2008 at 3:44pm Page 1 of 1