=(1-p)*100+p*25,000,000)
=100+24,999,900*p
We saw effective access time is directly proportional to the page fault rate . suppose one access out of 1,000 cause a page fault, effective access time is 25 ms the computer might be slow down by a factor of 250 because of demand paging. Suppose we want less than 10 % degradation,
We require:
110>100+25,000,000*p
10>25,000,000*p
P<0.0000004
that is to keep the slowdown due to paging to a reasonable level, we can allow only less than one memory access out 2,500,000 to page fault. in a demand paging system keep the page
fault rate low . In a different way dramatically the effective access time increase, slowing process execution. Another aspect of demand paging is the handling and overall use of swap space. Disk I/O to swap space is much faster than that to the file system. Questin is why it is fast ? the reason is swap space is allocated in much larger blocks, and file lookups and indirect allocation methods are not used. therefore possible for the system to gain better paging throughput by copying an entire file image into the swap space at process startup, 191and then performing demand paging from the swap space. Another option is to demand pages from the file system initially, but to write the pages to swap space as they are replaced. This approach will ensure that only needed pages are ever read from the file system but all subsequent paging is done from swap space.
Some systems attempt to limit the amount of swap space when binary files are used. Demand pages for such files are brought directly from the file system. However, when page replacement is called for, these pages can simply be overwritten and read in from the file system again if ever needed.swap space still used for pages not associated with a file; these pages include the stack and heap for a process. This technique is used in several systems.