Adama Science and Technology University: Operating Systems
Adama Science and Technology University: Operating Systems
UNIVERSITY
1. Flagot Mulugeta…………………….ugr/19655/12
2. Dawde Seifu…………………………ugr/19673/12
3. Dagim Debebe……………………….ugr/19904/12
4. Dagmawi Habtamu………………….ugr/19611/12
5. Bemnet Adinew………………………ugr/19973/12
6. Nathnael kumsa………………………………..ugr/19887/12
However, deciding, which pages need to be kept in the main memory and
which need to be kept in the secondary memory, is going to be difficult
because we cannot say in advance that a process will require a particular page
at particular time.
The demand paging system is somehow similar to the paging system with
swapping where processes mainly reside in the main memory(usually in the
hard disk). Thus demand paging is the process that solves the above problem
only by swapping the pages on Demand. This is also known as lazy swapper
( It never swaps the page into the memory unless it is needed).
If the bit is set to "valid", then the associated page is both legal and is in memory.
If the bit is set to "invalid" then it indicates that the page is either not valid or the
page is valid but is currently not on the disk.
Page fault
If the referred page is not present in the main memory then there will be a miss and
the concept is called Page miss or page fault.
The CPU has to access the missed page from the secondary memory. If the number of
page fault is very high then the effective access time of the system will become very
high.
6.With this technique, portions of the process that are never called are never
loaded.
3.Individual programs face extra latency when they access a page for
the first time.
Performance of Demand Paging
The performance of demand paging is often measured in terms of the effective access
time. Effective access time is the amount of time it takes to access memory, if the cost
of page faults are amortized over all memory accesses. In some sense it is an average
or expected access time.
Trap to OS; save user registers and process state; issue a disk read; wait for interrupt
from disk; wait for the CPU; restore the process status;
Memory access time = 100 nanoseconds, Page fault service time = 25milliseconds
Effective access time (EAT) = (1 – p) x 100 + p (25 msec)
=100+24,999,900 x p
COW allows more efficient process creation as only modified pages are copied.
A file is initially read using demand paging. A page-sized portion of the file is read
from the file system into a physical page. Subsequent reads/writes to/from the file are
treated as ordinary memory accesses.
Simplifies file access by treating file I/O through memory rather than read() write()
system calls.
Also allows several processes to map the same file allowing the pages in memory to
be shared.