+1 vote
201 views
Consider a demand paged memory system, page table is held in registers. It takes 800 nsec to service a page fault if empty page is available or replaced page is not modified and 950 nsec if the replaced page is modified, main memory access time is 120 nsec. If page to be replaced is modified 85% of time and page faultrate is 20% then average memory access time is ________. (Upto 1 decimal place)

edited | 201 views
0
I am getting the answer to be 305.5 but the test shows the answer 281.5
0
me too getting 305,5
0
I am also getting 305.5

+1 vote
0.2*(0.85*950+0.15*800)+0.8*120

=0.2(807.5+120)+0.8*120

=185.5+96

=281.5

0.85*950 since 85% time page to be replaced is modified.
by Active (2.6k points)
selected
+1

The same solution is available in the test series but my doubt is, in page fault why didn't you add the memory access time?

Isn't the formula like this:

P*( Page fault service time + Memory access time ) + (1-P)( Memory access time )

If there is no page fault then we can get it directly from memory but if there is page fault then we have to service the page fault looking if modified or not then we have to eventually access it from the memory.

0
I guess you are confusing page fault with cache access time
0

#source: Galvin

0

When there is no page fault means that page is present in the main memory itself and we don't have to do anything, but if there is a page fault then it means first we are accessing the main memory to know that the page is not present there and then we have to bring that page from the disk which the page fault service time. Correct me if I am wrong here.

+1
Thanks for clearing my doubt, actually most of the question that I was solving I didn't give any attention to the difference between page fault service time and additional service time. When it says additional then we have to add the memory access time, otherwise just the page fault service time.
+1
We don't go through the entire main memory.We just check the page table for valid or invalid bit which tells us whether the page is present or there is a page fault
+1

@jhaanuj2108 you are right,formula will be,EMAT =P*( Page fault service time + Memory access time ) + (1-P)( Memory access time ).  page fault service time is much much greater than memory access time generally page fault service time is considered in milliseconds and memory access time considered in nanosecond ,in this case we can ignore Memory access time in comparison to  Page fault service time. in Galvin ,memory access time is not considered because of above reason but in above question both are comparable so we can't ignore that.page fault service time does not include memory access time .There are three major components of the page fault service time-(1) service the page fault interrupt (2) read in the page (3) restart the process (according to Galvin).after it we have to access memory again for getting required page.

0

@Prateek Raghuvanshi

Are u sure?

0
yeah absolutely
0
Tats means key by test series is wrong.rgt?
0

@Arjun sir, please clear the confusion

which one is the correct formula

P*( Page fault service time + Memory access time ) + (1-P)( Memory access time )

or

P*( Page fault service time ) + (1-P)( Memory access time )

0

Can you explain why don't you add the memory access time in page service time?

P*( Page fault service time + Memory access time ) + (1-P)( Memory access time )

is this formula wrong for average memory access time?

+1 vote

Emat = P*( Page fault service time + Memory access time ) + (1-P)( Memory access time )

= P*(Page fault service time) + Memory access time

Page fault service time  = pm(Time taken when page modified) + (1-pm)(Time taken when page not modified)

= 0.85*950 + 0.15*800 = 927.5

Emat = 0.2*927.5+120 = 185.5 + 120 = 305.5

by (413 points)
edited

+1 vote
2