CSCI 4320 (Principles of Operating Systems), Fall 2005:
Homework 4

Assigned:
November 18, 2005.

Due:
November 28, 2005, at 5pm.

Credit:
20 points.

Reading

Be sure you have read chapter 4.

Problems

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.

  1. (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:

    $\displaystyle 0, 1, 7, 2, 3, 2, 7, 1, 0, 3
$

    (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?

  2. (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 $ R$ bits for the four pages are as follows after the first four clock ticks.

    Time $ R$ bit (page 0) $ R$ bit (page 1) $ R$ bit (page 2) $ R$ 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?

  3. (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?

  4. (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.

    1. Installing a faster CPU.

    2. Installing a larger paging disk.

    3. Increasing the number of processes (degree of multiprogramming).

    4. Decreasing the number of processes (degree of multiprogramming).

    5. Installing more main memory.

    6. Installing a faster paging disk.



Berna Massingill
2005-11-17