- For all memory accesses in a system with virtual memory we need Virtual Address to Physical Address translation and this goes through TLB.
- On TLB hit, we get the physical address.
- On TLB miss, we have to do page table access which always resides in physical memory (no page fault possible here).
- In the question it is given $1-$ level page table is used. So, TLB miss will need one physical memory access to get the physical address.
- Question mentions page fault rate as $10\%$ and this should default to $10$ page faults every $100$ memory accesses. (Since TLB miss rate is $5\%$ and for normal program run a TLB hit and page fault cannot happen for a memory access (can happen for invalid memory accesses), it is also possible to consider page fault rate as $10\%$ of all TLB misses. See the last part of the answer for this.
In the question page transfer time is given. This is different from page fault service time which includes the page transfer time + the memory access time as once the page is filled, a new memory access is initiated.
So, $\text{Average Memory Access Time} = \text{Address Translation Time} + \text{Data Retrieval Time}$
$\qquad = \text{TLB access time} + \text{TLB Miss ratio} \times {\text{Page Table Access time}} + \text{Main memory access time} + \text{Page fault rate} \times (\text{Page fill Time} + \text{Address Translation Time} + \text{Main memory access time}) + \text {Dirty Page Rate} \times \text{Page Write Time} $
$\qquad = 20 + 0.05 \times 100 + 100 + 0.1 \times (5000 + 20+ 0.05\times 100+ 100) + 0.1 \times 0.2 \times 5000$
$\qquad = 20 + 5 + 100 + 512.5 + 100$
$\qquad = 737.5 \; ns$
PS: If the question had given page fault service time also as $5000$ answer will be
$20 + 0.05 \times 100 + 0.9 \times 100 + 0.1 \times 5000 + 0.1 \times 0.2 \times 5000 = 25 +90 + 500 + 100 = 715\; ns$
"Assume that the TLB hit ratio is 95%, page fault rate is 10%"
If this statement is changed to
"Assume that the TLB hit ratio is 95%, and when TLB miss happens page fault rate is 10%"
$\text{Average Memory Access Time} = \text{Address Translation Time} + \text{Data Retrieval Time}$
$\qquad = \text{TLB access time} + \text{TLB Miss ratio} \times {\text{Page Table Access time}} + \text{Main memory access time} + \text{Page fault rate} \times (\text{Page fill Time} + \text{Address Translation Time} + \text{Main memory access time}) + \text {Dirty Page Rate} \times \text{Page Write Time} $
$\qquad = 20 + 0.05 \times 100 + 100 + 0.05 \times 0.1 \times (5000 + 20+ 0.05\times 100+ 100) + 0.05 \times 0.1 \times 0.2 \times 5000$
$\qquad = 20 + 5 + 100 + 25.625 + 5$
$\qquad = 155.625 \; ns$
If "memory access being restarted" is ignored for page fault, this will be
$\qquad = 20 + 0.05 \times 100 + 100 + 0.05 \times 0.1 \times (5000) + 0.05 \times 0.1 \times 0.2 \times 5000$
$\qquad = 20 + 5 + 100 + 25 + 5$
$\qquad = 155\; ns$
Ideally the answer key should be $715 - 738$ due to the confusion in the meaning of page transfer time as most standard resources use page fault service time instead.
If we assume page fault rate is given "only when TLB miss happens" answer should be $155-155.7$
A previous year question where page fault rate "per instruction" is clearly mentioned in question: https://gateoverflow.in/318/gate2004-47. This GATE2020 question is VERY POORLY framed and must be challenged.
Another similar question where TLB miss is taken as per memory access is given below (See the equation used in 3-e)
https://gateoverflow.in/?qa=blob&qa_blobid=5047954265438465988