This preview shows page 1. Sign up to view the full content.
Unformatted text preview: d page
Consider a paged virtual memory system with 32-bit virtual
addresses and 1KB pages. Each page table entry requires 32
bits. It is desired to limit the page table size to one page.
a. How many levels of page tables are required?
b. What is the number of entries of the page table at each
level? Hint: One page table size is smaller.
c. The smaller page size could be used at the top level or
the bottom level of the page table hierarchy. Which strategy
consumes the least number of pages?
One page consists of 1024 bytes, and each entry in the page table
requires 32 bit / 8 bits per byte = 4 bytes. Then a one-page page table
can hold 1024/4 = 256 entries. From a 22-bit virtual address, the
displacement part takes 10 bits (1KB = 210), and the rest, 22 bits
are used to get to the corresponding page table entry.
a. The no. levels of page tables required is 22 bits/8 bits (because 256
entries = 28) = 3 levels.
b. Level-1 table is 1KB, 256 entries; level-2 table is IKB, 256 entries;
and level-3 table is 768 Bytes, 192 entries.
c. The smaller page size should be used at the top level of the page
table hierarchy to consume the least number of pages.
(a) Briefly define alternative fetch ploicies.
Demand paging: A page is brought into main memory only
when a reference is made to a location on that page.
Prepaging: Pages other than the one demanded by a page
fault are brought in
(b) What is accomplished by page buffering?
A replaced page is not lost but rather is assigned to one of
two fists, the free page list if the page has not been modified, or the modified page list if it has. Note that the page
is not physically moved about in main memory; instead, the
entry in the page table for this page is removed and placed in
either the free or modified page list. The important aspect
of these maneuvers is that the page to be replaced remains
in memory. Thus if the process references that page, it is
returned to the resident set of that process at little cost.
Is it ever possible that FIFO will. outperform LRU? If so,
give a scenario. If not, argue why. (Assume that the number
of pages allocated is the same).
12342156212376321236. How many page faults occur for
the following page replacement algorithms, in a. static allocation of 4 frames and assuming that the allocation is
initially empty. Assume pure demand fetch. Show the execution to identify page faults. LRU (Least recently used):
10 FIFO (First-in-first-out): 14 OPT (Optimal): 8 Clock
(a) What is the difference between a resident net and a
Resident set: Pages that are in main memory.
Working set: Pages that are used by the processes.
(b) What is the difference between demand cleaning and
Demand cleaning: A page is written out to secondary memory only when it has been selected for replacement.
Precleaning: This policy writes modified pages before their
page frames are needed so that page...
View Full Document