When page fault doesn’t occur
TLB hit: time to access (TLB) + time to access (M/M)
TLB miss: time to access (TLB) + time to access (page table) + time to access (M/M)
Effective access time (EAT) = P x (TLB hit) + (1-P) x (TLB miss) = 0.05 x (17 + 55) + 0.95 x (17 + 55 + 55) = 124.25 ns
where page table resides in main memory (i.e. time to access page table = time to access main memory). And, P is the hit ratio, which is 5%, and (1-p) is the miss ratio is 95%.
When page faults occur
In this case, the page needs to swap in from the hard disk.
TLB hit: time to access (TLB) + time to access (M/M) + swap in from (H/D)
TLB miss: time to access (TLB) + time to access (page table) + time to access (M/M) + swap in from (H/D)
Effective access time (EAT) = P x (TLB hit) + (1-P) x (TLB miss) = 0.05 x (17 + 55 + 4700) + 0.95 x (17 + 55 + 55 + 4700) = 4824.25 ns
Effective Memory Access Time
= Page hit ratio x EAT + Page fault ratio x EAT = 0.67 x (124.25) + 0.33 x (4824.25) = 1675.25 ns
Reference: https://www.youtube.com/watch?v=Z4vzWxCcDCY&t=11s [lang: hindi]