Illustrate how demand paging affects system performance

In this post we are discussing about  Illustrate how demand paging affects system performance

demand paging affects system performance:-

  1. Effective Access Time Calculation: The effective access time in a demand-paged memory system is a combination of memory access time and the time required to service a page fault. It is calculated as follows: Effective Access Time = (1 – p) × memory access time + p × page fault time
    • “p” represents the probability of a page fault (0 ≤ p ≤ 1).
    • Memory access time typically ranges from 10 to 200 nanoseconds.
  2. Page Fault Handling Process: When a page fault occurs, several steps must be taken, including:
    • Trapping to the operating system.
    • Saving user registers and process state.
    • Determining that the interrupt is a page fault.
    • Locating the page on disk.
    • Issuing a disk read request and waiting for it to be serviced.
    • Allocating CPU to other processes during the wait (if needed).
    • Correcting page tables and other tables to show the page is in memory.
    • Resuming the interrupted instruction.
  3. Page Fault Time Components: Page fault service time consists of three major components:
    • Servicing the page-fault interrupt.
    • Reading in the page from disk.
    • Restarting the process.
  4. Disk I/O Time: Disk I/O time for page fault handling includes factors such as disk seek time, latency time, and transfer time. A typical total paging time can be around 8 milliseconds, including both hardware and software processing.
  5. Impact of Page-Fault Rate: The effective access time is directly proportional to the page-fault rate. If page faults are infrequent, the impact on performance is minimal. However, if page faults occur frequently, it can significantly slow down process execution.
  6. Managing Page-Fault Rate: To keep performance degradation at an acceptable level (e.g., less than 10 percent slowdown), the page-fault rate must be kept low. The acceptable page-fault rate depends on the specific system and its performance requirements.
  7. Swap Space Efficiency: Demand paging often involves using swap space, which is faster for paging than the file system due to larger block sizes and no file lookups. Systems may copy entire file images to swap space for better paging throughput.
  8. Optimizing Binary Files: Some systems optimize performance by demand paging binary files directly from the file system. These pages can be overwritten when replaced, and pages can be read from the file system again if needed. This approach serves as a compromise between file-based and swap-based demand paging.
  9. Balancing Performance and Memory Management: Effective demand paging requires a balance between minimizing page faults and efficiently managing memory resources. Careful system design and configuration are essential to achieve optimal performance.

Leave a Reply

Your email address will not be published. Required fields are marked *