I am getting confused with calculation of EEMAT(Effective memory access time). I decided to close the book and think on my own and make an equation. Please see whther this is correct or not. I thought a lot and also refereed google but i am lost. Please help!
Let TLB hit ratio = x.
TLB access time = c
main memory access time = m
page fault rate = p; page fault service time = S
First i will access TLB. In case of TLB hit i will directly access main memory(so time here = c+m in case of TLB hit)
If TLB Miss, then i will have to access via page table. I am assuming here n level page table(so n page tables needed to access main memory).
In case of TLB Miss, i will access page table(n level) --> it can be hit or miss. If page hit, then time = c+(n+1)m
If page fault, time = c+m+(n+1)m --> TLB access time + first i access page table to know that there is no valid frame in 1st level page table itself(i got another doubt here, in case of page fault in n level paging, valid bit is 0(invalid page) in 1st level or any of n levels or in nth level page table???) + n level page table access in main memory + finally main memory
So EEMAT = x(c+m)+(1-x){ (1-p)[(n+1)m] + p[S + m + (n+1)m ] }
Is this correct???
- My another doubt:
in case of page fault in n level paging, valid bit is 0(invalid page) in 1st level or any of n levels or in nth level page table???