2.7k views

I got some doubt while solving previous year questions:-

Since While calculating EMAT and question involves page fault service time,we use formulae:-

p*s+(1-p)*m ,taken from Galvin

p is page fault rate

s is page fault service time

m is main memory access time

Why don't we include 2m instead of m in case if it is not a page fault?With the (1-p) as probability i will not get a page fault so for these i will goto page table and then to main memory.Why to use m instead of 2m?

Where as in questions where page fault service time is not there we use 2m

Ref question;- https://gateoverflow.in/2067/gate2014-3-33 which does make sense.

So why in first reference/doubt we are not using 2m instead of m in case of NOT a page fault?

edited | 2.7k views
0

Please explain what is p,s and m its confusing

another thing is those 2 question are different

https://gateoverflow.in/2067/gate2014-3-33 here we are talking about TLB, in TLB we store recently used Virtual Address, so TLB miss is not equal to page fault.

https://gateoverflow.in/2122/gate2011-20-ugcnet-june2013-ii-48 we are talking about memory

0
@ rahul sharma 5   The difference is that when we talk about a TLB, it is known that there is a page table (that is assumed to reeside in the physical memory). So when there is a miss, the same M amount of time is taken to access page table to get the physical address before another M amount of time is taken to retrieve the actual data
0

@tesla:- updated the question

0

Yes you are correct @rahul

If there is tlb miss then we go to page table ( main memory) after successfully finding physical address first we search in cache for data else we search in main memory

In general in cache is not mentioned then it should be 2m

So answer to this question https://gateoverflow.in/2122/gate2011-20-ugcnet-june2013-ii-48 would be exactly 50

Let see what other have to say

According to Galvin EMAT = (1-p) ma + p* page fault service time

Page fault service time (if nothing specific is given ) includes time taken to access secondary memory to find the page + time taken to access the main memory after the page is loaded.

Suppose we want a page called Page X which is not in the Main memory, the following things will happen -

1) Page Table (assuming there is one) will search for Page X and wont find any, this will lead to Page Fault.

2) This will begin the Page Fault Service Time where the it will access the Secondary memory for Page X and once found will load it into the Primary memory and update the page table.

3) Now we will access the Primary memory knowing it is loaded into the Primary memory successfully.

So , " The time required to access page in secondary memory is 100 ns. " ,

then the Page Fault Service Time would be 100 + 10 = 110 ns. where Time required to access a page in primary memory is 10 ns.

And 100 ns is time require to access page in secondary memory .

we can say , Accessing the page in secondary memory + Loading the page in main memory + Accessing the page in Main memory = 100 ns where service the page fault time given is 100 ns .

see , page fault service time = page fault overhead + swap page out + swap page in + restart overhead

so all these is included there in service time ...

by Veteran (70.1k points)
edited by
0

Sir but my doubt is in case there is no page fault ,then why dont we use 2*m instead of m.

With (1-p) probability there is no page fault,so access will take 2m time,to access page table and to acces main memory after that

See https://gateoverflow.in/669/gate2000-2-22,one more example,arjun sir mentioned

Since nothing is told about page tables, we can assume page table access time is included in memory access time

But in some qustions we use 2*m to include page table access time,like:-  https://gateoverflow.in/2067/gate2014-3-33

+2
@bikram he is telling that for accessing page table we require one memory access than for accessing data we require another memory access thus 2m in case if page hit

i think :- here  S-> stands for page fault service time and m->main memory access time

if there is no page fault....(consider single level paging)

MAT=m(for page table) only bcoz it will provide the frame no.(main memory) where the real page exits...(now once the cpu find the effective address of the data it will  start execution)....

​​​​​​​1.here we calculate the time taken to find out effective address... once the real address of the data(page ) is found then memory access time is over...

????

by Loyal (8k points)
0

See this example from Galvin and please tell me when there is a NO page fault,then why it will take 200 instead of 400?

This from 325 page number from galvin, 7th edition

0

bcoz we access the main memory only once ...i.e for  finding the frame no. for the page requested by the CPU...(process are divided into pages and main memory is divided into frames....a frame contains a single page....page table holds the information about the pages (i.e what is the frame no. where a page is presents....)

0
No. It is time to access main memory once for page table access and once for actual frame access from main memory.But in case of page fault service time question we mostly ignore the time to access page table and i am looking the reason for that.

But in case of TLB questions we include the page table access time.
0
@ rahul sharma 5  I just read that from the book. The version I am using is 9 but I think there shouldn't be any difference.

Before this calculation, read the paragraph before it.... they have mentioned "These tasks may take from 1 to 100 microseconds each." So I think they are considering 100 + 100 ns  .......
0
In any case, we are faced with three major components of the page-fault
service time:
1. Service the page-fault interrupt.
3. Restart the process.

Yes, so that page table access time is included in the fault service time....so not 2M ..... I guess
0
I think you are not getting me.thWhen ever there is a page fault then page fault service time will include all the activities to access the page table and all the steps.

But i am concerned when there is no page fault,then why rae they taking m time.

As you said 100+100=200,so how in exam i will know whether page fault time is included or not.See the links i shared.:
0

So we are back at the discussion we started with. Unless they mention about page table we take it for granted that it is being included in the values already given. I mean page fault service may include page access time and so does the 'm' memory access time ..
0

Ok.so this is one scenario that i have seen in all the previous ear questions.

Now ,But when we solve the questions regarding TLB,and there is no mention of page fault service time,so in those cases we use the time to access page table

Like in  https://gateoverflow.in/2067/gate2014-3-33 ? This is only what i can conclude:(