Demand paging scheme - Conclusion

Some pages are there in the main memory. Others will be obtained as required. 

Page fault delays execution. Minimize page faults.

To achieve this : 

i) Use a good page removal algorithm (for e.g use LRU)

ii) Working set : the no. of blocks given to a job must equal the size of its working set.

The above points are implemented by OS

Working set - is a set of pages which a job reference in one time slice.

But , we cannot use (ii) in the same from, since the size of the working set is not necessarily same in all time slices of a job.

The size of the working set is merely guidance. Inspite of the working set, there will be page faults because of the following:

We have earlier loader T1 = {0,1,2}, But during execution , we need T1 = {0,1,4}

So page fault occurs.

(i) & (ii) are the guidelines for the O.S

There is a 3rd guidelines for the user to minimize no. of page faults.

Guidelines to user

iii) Follow some guidelines while writing program (write program so that execution is local most of time)

a) Local in time (temporal locality) : Remain in page 0 all the time

b) Local in space (spatial locality) : Move from page 0 to page 1

Example : Sequential execution (don’t jump too far)

If demand paging scheme is a failure then we end up in thrashing.
Thrashing

- The CPU is busy during work for paging scheme, but jobs themselves are not running. Too much of overhead. 

Thrashing occurs for two reasons:

a) Too many page faults

b) Too many jobs in multiprogramming mode.

For e.g: 0 to 100k memory; 20 K for O.S; 1 job = 1 K;  80 k memory – 80 blocks

so 80 jobs in multiprogramming mode.

Advantages of Demand paging

i) it allows a large no. of jobs in multiprogramming mode.

ii) It uses memory very efficiently.

iii) It allows to run large jobs. The size of the job can be greater than the size of the memoy The limitation is on secondary memory& not main memory.

Disadvantages

i)It still wastes memory as page breakage

ii)It requires special hardware.

iii) It cannot take advantage of the logical organization of a job.

The job P1 is logically organized into main(), function 1() & function 2()

Demand paging scheme does not look at logical organization of a job, since it looks only for pages.



 


<< Prev | Next >>

Home | Notes Catalog | Privacy & Terms | About us | Contact us | Site map |     Copyright © Notesbin.com 2016.                                     Template by WebThemez.com