CSCI 4320 (Principles of Operating Systems), Fall 2005:
Homework 4
- Assigned:
- November 18, 2005.
- Due:
- November 28, 2005, at 5pm.
- Credit:
- 20 points.
Be sure you have read chapter 4.
Answer the following questions. You may write out your answers by
hand or using a word processor or other program, but please submit
hard copy, either in class or in my mailbox in the department office.
- (5 points)
Consider a small computer system with only four page frames
and address spaces consisting of eight pages.
Suppose we start out with all page frames empty
(pure demand paging) and run a program that references
pages in the following order:
(That is, its first reference to memory is in page number 0,
its second reference to memory is in page number 1, etc.)
How many page faults will occur during the running of the
program if FIFO page replacement is used?
- (5 points)
Consider another small computer system with only four
page frames. Suppose you have implemented the aging
algorithm for page replacement, using 4-bit counters
and updating the counters after every clock tick,
and suppose the
bits for the four pages are as
follows after the first four clock ticks.
Time |
bit (page 0) |
bit (page 1) |
bit (page 2) |
bit (page 3) |
after tick 1 |
0 |
1 |
1 |
1 |
after tick 2 |
1 |
0 |
1 |
0 |
after tick 3 |
1 |
0 |
1 |
1 |
after tick 4 |
1 |
1 |
0 |
1 |
What are the values of the counters (in binary)
for all pages after these four clock ticks?
If a page needed to be removed at that point,
which page would be chosen for removal?
- (5 points)
The operating system designers at Acme Computer
Company have been asked to think of a way of reducing
the amount of disk space needed for paging.
One person proposes never saving pages that
only contain program code, but simply paging them in
directly from the file containing the executable.
Will this work always, never, or sometimes?
If ``sometimes'', when will it work and when will it not?
- (5 points)
A computer at Acme Company used as a compute server
(i.e., to run batch jobs) is observed to be running slowly
(turnaround times longer than expected).
The system uses demand paging, and there is a separate disk
used exclusively for paging.
The sysadmins are puzzled by the poor performance,
so they decide to monitor the system.
It is discovered that
the CPU is in use about 20% of the time, the paging disk
is in use about 98% of the time, and other disks are in
use about 5% of the time. For each of the following,
say whether it would be likely to increase CPU utilization
and why.
- Installing a faster CPU.
- Installing a larger paging disk.
- Increasing the number of processes (degree of
multiprogramming).
- Decreasing the number of processes (degree of
multiprogramming).
- Installing more main memory.
- Installing a faster paging disk.
Berna Massingill
2005-11-17