CSE 120 Spring 2002 Homework 3
Due 23 May 2002
Problem 1
Consider a system that uses demand paging. The backing
store is stored on a disk that is used only for backing store.
Define the utilization of a resource (over
some period of time) to be the percentage of time that the resource is
being used. When you measure the utilizations of different resources in
the system, you find that the utilization of the CPU is 20%, the utilization
of the backing store disk is at 99%, and the utilizations of the other
devices (such as the other disks and the network adaptor) are 5% or lower.
-
What phenomenon would most likely result in these
characteristics?
-
What effect would each of the following actions have
on the CPU utilization?
-
Increasing the speed of the CPU.
-
Increasing the capacity of the backing store disk.
-
Increasing the page size. The effect of this is hard
to predict.
-
Increasing the amount of physical memory.
-
Decreasing the degree of multiprogramming.
Problem 2
Assume a fixed amount of physical memory and assume
LRU demand paging. Give a reference string that has the following two properties:
-
If you double the size of a page, then the
number of page faults is reduced;
-
If you halve the size of a page, then the
number of page faults is reduced.
Problem 3
Consider the following information about a virtual
memory system that employs both paging and segmentation.
-
The word size is 32 bits.
-
The page and segment table entries each occupy one
word.
-
The page size is 512 words.
-
A page table occupies at most one page.
-
A virtual address is n bits long and is a
reference to a word. It has the form (s1, s2,
p,
w).
Let |s1|, |s2|,
|p| and |w| denote the length, in bits, of each of the four
address components. Hence, n = |s1| + |s2|
+ |p| + |w|.
-
What is the value of |w|?
-
What is the maximum number of pages per segment and
what is the corresponding value of |p|?
-
Using the determined values of |w| and |p|,
which of the following is choices for |s1| and |s2|
is preferable?
|s1| = |w| and
|s2| = n - |p| - |w|
or |s2| = |w| and |s1|
= n - |p| - |w|
Would either choice result in a larger virtual
address space? Explain.
Problem 4
If a large number of programs is kept in main memory,
then there is almost always another ready program when a page fault occurs.
Thus, CPU utilization is kept high. If, however, we allocate a large memory
space to each of a few programs, then each program produces a smaller number
of page faults. Thus, CPU utilization is kept high.
Are these two arguments correct? Which policy,
if either, should be preferred? Why?
last edited 15
May 2002 by kam