3,452 views
3 votes
3 votes
Suppose: TLB lookup time = 20 ns

TLB hit ratio = 80%

Memory access time = 75 ns

Swap page time = 500,000 ns

50% of pages are dirty

OS uses a single level page table

What is the effective access time (EAT) if we assume the page fault rate is 10%? Assume the cost toupdate the TLB, the page table, and the frame table (if needed) is negligible.

1. 3777.5ns

2. 30220ns

3. 15110ns

4. 7555ns

2 Answers

Best answer
6 votes
6 votes
TLB lookup time = $20$ ns

TLB hit ratio = $80$%

Memory access time = $75$ ns

Swap page time = $500,000$ ns

$50%$ of pages are dirty

Page Fault rate =$10$%

When there is a TLB hit, we no need to consider page fault,moreover here is no requirement of page translation. Because that information not given in question.

When TLB miss is occured then only we need to check, if there is a page fault or not

if there is a page fault, we need to consider, page fault service time

So,

TLB hit(TLB access time)+TLB miss(no pagefault*MM access time+pagefault(dirty page*PFST+no dirty page*2*PFST))

=$0.8(20+75)+0.2[0.9(20+75+75)+0.1(0.5\times 500000+0.5(2\times 500000))]$

=$0.8\times 95+0.2[153+0.1(250000+ 500000))]$

=15106.6ns
selected by
0 votes
0 votes

main confusion here is , there are two approaches or say formula in case of page fault with TLB 

that are – 

1 ) EAT = TLB hit(TLB access time) +TLB miss(no pagefault*MM access time+pagefault(dirty page*PFST+PFST))

2 ) EAT = No Page Fault(TLB hit+TLB miss)+ Page Fault (TLB hit+TLB miss+ Page swap time)

here, first formula assume that there is no page fault in case TLB hit and second formula assume that there will be page fault independent from TLB hit or TLB miss

the fact is TLB hit doesn't mean that corresponding page is in main memory. Page fault can still occur

source- https://stackoverflow.com/questions/6398811/can-a-tlb-hit-lead-to-page-fault-in-memory#:~:text=Page%20fault%20can%20still%20occur,page%20available%20in%20main%20memory.&text=On%20a%20TLB%20miss%20kernel,t%20lead%20to%20page%20fault.

clearly means that first approach is wrong so go with second formula, i have also checked on some other platform they have also used the second one like https://www.gatevidyalay.com/page-fault-paging-practice-problems/

now coming to dirty pages-

we only have to swap in pages in case of page fault(and replaced page is not dirty) 

but we also have to swap out in case of dirty page and then swap in the required page 

source – https://gateoverflow.in/77917/testbook-os-test

means in case of dirty pages the formula becomes-

EAT=No Page Fault(TLB hit+TLB miss)+ Page Fault (TLB hit+TLB miss+ Page swap in time + dirty pages x page swap out time)

​​​​​​​hope it helps 

No related questions found