search
Log In
1 vote
597 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)
in Operating System
edited by
597 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

2 Answers

1 vote
 
Best answer
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.

selected by
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?

0
i saw sachin mittal sir comment and he said that in the page fault service time we assume the memory access time has been included
0

@Ashutosh07091999 which comment of Sachin Mittal sir u saw? 

1

https://gateoverflow.in/669/gate2000-2-22

see sachin mittal sir comment on this ques

0
obviously wrong solution correction required
4 votes

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


edited by

Related questions

1 vote
0 answers
1
221 views
Consider the two-dimensional array A$:$ int A[ ] [ ] = new int[100][100]; where A[0][0] is at location 200 in a paged memory system with pages of size 200. A small process that manipulates the matrix resides in page 0 (locations 0 to 199). Thus, every instruction fetch will be from ... contains the process and other two are initially empty? for(int j=0;j<100;j++) for(int i=0;i<100;i++) A[i][j]=0;
asked Jan 24, 2017 in Operating System Samujjal Das 221 views
1 vote
1 answer
2
274 views
Consider a computer system having 20 physical page frames numbered from 1 to 20 which are initially empty. Now, a program accesses the pages numbered 1, 2 ..........100 twice. The number of page fault generated by optimal page replacement policy is __________.
asked Jan 23, 2018 in Operating System Ajay Jadhav 274 views
3 votes
1 answer
4
170 views
Self doubt: What is the rule or keyb point we should keep in mind while solving problems on LRU page replacement algorithm? Please explain with examples.
asked Jan 18, 2018 in Operating System Sona Barman 170 views
...