CS FundamentalsVery hardProduct company interview · GATE level
A system with a TLB and a two-level page table has TLB access time 10 ns (searched before memory), memory access time 100 ns and a TLB hit ratio of 90%; a TLB miss requires walking both levels in memory. In addition, 1 in every 100,000 memory references causes a page fault; servicing a fault takes 8 ms if the victim page is clean and 20 ms if it is dirty, and 30% of victims are dirty. Counting a faulting reference as just its service time, what is the effective access time?
- A. 130 ns
- B. About 210 ns
- C. About 236 ns
- D. About 246 ns
Correct answer: D. About 246 ns
Without faults: hit 10 + 100 = 110 ns; miss 10 + 2 x 100 (two table levels) + 100 = 310 ns; average 0.9 x 110 + 0.1 x 310 = 130 ns. Average fault service = 0.7 x 8 + 0.3 x 20 = 11.6 ms = 11,600,000 ns. EAT = (1 - 10^-5) x 130 + 10^-5 x 11,600,000 = about 130 + 116 = 246 ns. 210 ns ignores the dirty pages (8 ms only); 236 ns treats the page table as single-level; 130 ns ignores faults altogether - yet one fault in 100,000 almost doubles the access time.
More Operating Systems questions
- Memory access takes 200 ns. A page fault takes 8 ms to service if the replaced page is clean and 20 ms if it is dirty, and 40% of replaced…
- An inode has 10 direct pointers, one single-indirect, one double-indirect and one triple-indirect pointer. Blocks are 2 KB and block…
- A Unix-style inode has 12 direct pointers plus single-, double- and triple-indirect pointers; blocks are 4 KB and pointers 4 bytes. With…
- Each process in a system spends 70% of its time waiting for I/O, independently of the others. Using the model CPU utilisation = 1 - p^n…
- Round Robin is used with a quantum of 4 ms and a context-switch time of 1 ms. There are always 10 CPU-bound processes ready and none does…
- A TLB has 64 entries. With 4 KB pages, what is its reach (the memory it can map without a miss)? If 16 of the entries instead map 2 MB…