Ticker

6/recent/ticker-posts

Operating system subjective question(paging and page fault) for competition exam(9)

Q1 Consider a paging system where memory access time is 60ns and page fault service time in 20ms.if a one page fault occured after every access in memory the find EMAT.

EMAT=p(pf+m)+(1-p)m memory access time=60ns page fault service time=20ms page fault rate=1/10 power 6 EMAT=1/10 power 6*20ms+60ns EMAT=20ns+60ns=80ns[ins=10power -6ms]



Q2.Consider a process executing on an operating system that uses demand paging. The average time for a memory access in the system is M units if the corresponding memory page is available in memory, and D units if the memory access causes a page fault. It has been experimental measured that the average time taken for a memory access in the process is X units.

Given, average time for a memory access = M units if page hits, and average time for a memory access = D units if page fault occurred. And total/experimental average time taken for a memory access = X units. Let page fault rate is p. Therefore, Average memory access time = ( 1 – page fault rate) * memory access time when no page fault + Page fault rate * Memory access time when page fault → X = (1 – p)*M + p*D = M – M*p + p*D → X = M + p(D – M) → (X – M) = p(D – M) → p = (X – M) / (D – M)



Q3.Consider a paging system that uses 1-level page table residing in main memory and a TLB for address translation. Each main memory access takes 100 ns and TLB lookup takes 20 ns. Each page transfer to/from the disk takes 5000 ns. Assume that the TLB hit ratio is 95%, page fault rate is 10%. Assume that for 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 update time is negligible. The average memory access time in ns (round off to 1 decimal places) is

M = 100 ns T = 20 ns D = 5000 ns h = 0.95 p = 0.1, (1-p) = 0.9 d = 0.2, (1-d) = 0.8 = h×(T+M) + (1-h)[(1-p)×2M + p[(1-d)[D+M] + d(2D+M)] + T] = 0.95×(20+100) + (1-0.95)[(1-0.1)×200 + (0.1)[(1-0.2)[5000+100] + (0.2)(10000+100)] + 20] = 154.5 (in ns)


Q4.A paging system uses a TLB.A TLB takes 10ns and memory access 50ns .What is EMAT if TLB hit 90% and no page fault.

EMAT=h(TLB+m)+miss ratio*(TLB+page table access+memory access) 0.9*(10+50)+0.1(10+50+50) =54+11=65


Q5.Consider a system with a two-level paging scheme in which a regular memory access takes 150 nanoseconds and servicing a page fault takes 8 milliseconds. An average instruction takes 100 nanoseconds of CPU time and two memory accesses. The TLB hit ratio is 90% and the page fault rate is one in every 10,000 instructions. What is the effective average instruction execution time?

Given- Number of levels of page table = 2 Main memory access time = 150 ns Page fault service time = 8 msec Average instruction takes 100 ns of CPU time and 2 memory accesses TLB Hit ratio = 90% = 0.9 Page fault rate = 1 / 104 = 10power-4 Assume TLB access time = 0 since it is not given in the question. Also, TLB access time is much less as compared to the memory access time. Effective memory access time without page fault = 0.9 x { 0 + 150 ns } + 0.1 x { 0 + (2+1) x 150 ns } = { 0.9 x 150 ns } + { 0.1 x 450 ns } = 135 ns + 45 ns = 180 ns



Post a Comment

0 Comments