A machine has a 32-bit address space and an 8-kb page. The page table is entirely in hardware, with one 32-bit word per entry. When a process starts, the page table is copied to the hardware from memory, at one word every 100 nsec. If each process runs for 100 msec (including the time to load the page table), what fraction of the cpu time is devoted to loading the page tables?
Answers
Answer: what fraction of the cpu time is devoted to loading the page tables - 52%
Explanation:
8 KB pages will lead to 13 bits for the offset → 2 ¹⁹ entries in the page table
Time to upload page table = 2 ¹⁹ x 100 ns = 52.4288 msec
Loading of pages takes 52 msec.
If each process runs for 100 msec (including the time to load the page table), then 52 msec is used to load the page table and remaining 48 msec is used for running .
So total of 52% of time is used in loading the page tables.
Here is the solution to the question about the CPU time:
Notations used:
TPT Load = Time to load a page table
T = Running time of a process
8 KB pages → 13 bits for the offset → 2
19 entries in the page table
TPT Load = 2
19
· 100ns = 52, 4288ms
TPT Load
T
= 0, 52
52% of the CPU time is devoted to loading the page tables.