Chapter 9
Chapter 9
Chapter 9
• 9EF
• 111
• 700
• 0FF
• 9E F - 0E F
• 111 - 211
• 700 - D00
• 0F F - EFF
9.5)
Discuss the hardware support required to support
demand paging.
For every memory-access operation, the page table
needs to be consulted
to check whether the corresponding page is resident
or not and whether
the program has read or write privileges for
accessing the page. These checks have to be
performed in hardware. A TLB could serve as a cache
and improve the performance of the lookup
operation.
9.6An operating system supports a paged virtual
memory, using a centralprocessor with a cycle time
of 1 microsecond. It costs an additional
1microsecond to access a page other than the
current one. Pages have 1000words, and the paging
device is a drum that rotates at 3000 revolutionsper
minute and transfers 1 million words per second.
The followingstatistical measurements were
obtained from the system:•1 percent of all
instructions executed accessed a page other than
thecurrent page.•Of the instructions that accessed
another page, 80 percent accesseda page already in
memory.
When a new page was required, the replaced page
was modifed 50percent oF the time.Calculate the
eFFective instruction time on this system, assuming
that thesystem is running one process only and that
the processor is idle duringdrum
transFers.Answer:eFFective access
time=0.99×(1msec + 0.008×(2msec)+
0.002×(10,000msec + 1,000msec)+
0.001×(10,000msec + 1,000msec)=(0.99 + 0.016 +
22.0 + 11.0)msec=34.0msec
Question 4:
Consider the following page reference string:
1,2,3,4,2,1,5,6,2,1,2,3,7,6,3,2,1,2,3,6
How many page faults would occur for
replaement by LRU, FIFO, optimal, for
one, two, three, four, five, six and seven
frames? All frames are
initially empty and first unique page reference
causes a page fault.
Answer:
# frames 1 2 3 4 5 6 7
LRU 20 18 15 10 8 7 7
FIFO 20 18 16 14 10 10 7
Optimal 20 15 11 8 7 7 7
9.12)
Consider a demand-paged computer system where
the degree of multiprogramming is currently fixed at
four. The system was recently measured to
determine utilization of the CPU and the paging disk.
Three
alternative results are shown below.
a. Thrashing is occurring.
b. CPU utilization is sufficiently high to leave things
alone, and increase degree of multiprogramming.
c. Increase the degree of multiprogramming.
9.15)
A simplified view of thread states is Ready, Running,
and Blocked, where a thread is either ready and
waiting to be scheduled, is running on the processor,
or is blocked (for example, waiting for I/O). This is
illustrated
in Figure 9.31. Assuming a thread is in the Running
state, answer the following questions, and explain
your answer:
Question 7:
It has been observed that the number of
instructions executed between
pagefaults is directly proportional to the number
of frames allocated to
the process. If twice the number of frames are
allocated, the mean
interval between page faults is also doubled.
An instruction takes
normally 1 microsec, but with a pagefault it
takes 2001 microsec. The
process takes 60 secs to run during which it gets
15000 page faults. How
long would it take for the process if twice the
memory were made available
to it?
c.
No. Increasing the degree of multiprogramming
means even fewer frame per process. It worsen
the thrashing. All processes might not be able to get
their pages in a reasonable speed, and
nobody gets to run smoothly.
d.
Yes. Decreasing the degree of multiprogramming
means more frames per process. It reduces the
thrashing. The remaining processes might be able to
get their pages in a reasonably fast speed,
and get to run smoothly.
e.
Yes. Installing more main memory means more
frames per process. It reduces the thrashing.
The processes might be able to get their pages in a
reasonably fast speed, and get to run
smoothly.
f.
No. The problem is not the size of hard drive.
Trashing is caused by the main memory capacity
and the accessing speed.
g.
h.
No likely. Increasing page sizes doesn't change the
fact that the physical memory for each
process's pages is not big enough. Plus, increasing
pages sizes would cause a longer accessing
time to the disk. The extra bits loaded from the disk
increases, which is a waste.
What causes thrashing? How does the system
detect thrashing?
Once it detects thrashing, what can the system
do to eliminate
this problem?