Skip to content
Official PYQ · 2020

GATE CS 2020 Q53 — Memory Management and Virtual Memory

Explain with AI
Consider a paging system that uses 11-level page table residing in main memory and a TLB\textsf{TLB} for address translation. Each main memory access takes 100100 ns and TLB\textsf{TLB} lookup takes 2020 ns. Each page transfer to/from the disk takes 50005000 ns. Assume that the TLB\textsf{TLB} hit ratio is 95%95 \%, page fault rate is 10%10 \%. Assume that for 20%20 \% of the total page faults, a dirty page has to be written back to disk before the required page is read from disk. TLB\textsf{TLB} update time is negligible. The average memory access time in ns (round off to 11 decimal places) is ___________
View worked solution

Answer: 155:156

To find the Average Memory Access Time (AMAT\text{AMAT}), we analyze the two primary cases based on the TLB\text{TLB} hit ratio (h=0.95h = 0.95):

  1. Case 1: TLB Hit (Probability = 0.950.95)
    The translation is found in the TLB\text{TLB}, and then the main memory is accessed for the data.
    Timehit=Ttlb+Tm=20+100=120 ns\text{Time}_{\text{hit}} = T_{\text{tlb}} + T_m = 20 + 100 = 120\text{ ns}
  2. Case 2: TLB Miss (Probability = 0.050.05)
    The page table in main memory must be accessed first (Ttlb+Tm=120 nsT_{\text{tlb}} + T_m = 120\text{ ns}). Then, we check if the page is present in main memory:
    • Page Hit (Probability = 0.900.90): The page is in memory. We access the data directly.
      Timemiss, hit=(Ttlb+Tm)+Tm=120+100=220 ns\text{Time}_{\text{miss, hit}} = (T_{\text{tlb}} + T_m) + T_m = 120 + 100 = 220\text{ ns}
    • Page Fault (Probability = 0.100.10): The page must be fetched from disk.
      • With 20%20\% probability, a dirty page is written back and the new page is read: 5000+5000=10000 ns5000 + 5000 = 10000\text{ ns}.
      • With 80%80\% probability, only the new page is read: 5000 ns5000\text{ ns}.
      • Average Page Fault Service Time (TpfT_{pf}) = 0.20×10000+0.80×5000=6000 ns0.20 \times 10000 + 0.80 \times 5000 = 6000\text{ ns}.
      After servicing the fault, the data is accessed in memory (Tm=100 nsT_m = 100\text{ ns}).
      Timemiss, fault=(Ttlb+Tm)+Tpf+Tm=120+6000+100=6220 ns\text{Time}_{\text{miss, fault}} = (T_{\text{tlb}} + T_m) + T_{pf} + T_m = 120 + 6000 + 100 = 6220\text{ ns}
    Average Timemiss=0.90×220+0.10×6220=198+622=820 ns\text{Average Time}_{\text{miss}} = 0.90 \times 220 + 0.10 \times 6220 = 198 + 622 = 820\text{ ns}

Now, we calculate the overall AMAT\text{AMAT}:

AMAT=0.95×Timehit+0.05×Average Timemiss\text{AMAT} = 0.95 \times \text{Time}_{\text{hit}} + 0.05 \times \text{Average Time}_{\text{miss}} AMAT=0.95×120+0.05×820=114+41=155 ns\text{AMAT} = 0.95 \times 120 + 0.05 \times 820 = 114 + 41 = 155\text{ ns}

Thus, the average memory access time is 155 ns (which lies in the range 155 to 156).

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Memory Management and Virtual Memory questions