Request page scheduling read operating system concept version 6

Source: Internet
Author: User

The request page scheduling system is similar to the paging system with swap. The process resides on the secondary storage (usually a disk ). When you need to execute a process, replace it with the memory. However, instead of switching the entire process into the memory, lazy Swapper is used. Lazy Swapper calls pages to the memory only when pages are needed. Because processes are viewed as a series of pages rather than a large continuous space, it is technically incorrect to use "exchange. The program operates on the entire process, while the paging program only operates on a single page of the process. Therefore, when discussing request page scheduling, you need to use the page Adjustment Program instead of the exchange program.

When a process is switched in, the paging program speculate that those pages will be used before the process is switched out. The pagination program not switches the entire process, but calls the necessary pages into the memory. In this way, the paging program avoids reading unused pages and reduces the switching time and the required physical memory space.

For this solution, some form of hardware support is required to distinguish those pages in the memory and those pages on the disk. Valid-invalid bits can be used for this purpose. However, when this bit is set to "valid", this value indicates that the relevant page is valid and in the memory. When this bit is set to "invalid", this value indicates that the related page is invalid or valid but on the disk. For pages transferred to memory, the page table entries are set as usual. For pages not in memory, the page table entries are set as invalid or contain the addresses of the pages on the disk.

Note that if a process never tries to access a page marked as invalid, there is no impact. Therefore, if it is inferred that the process is correct and the value is transferred to all the pages that are really needed, the process can run normally as if all pages have been transferred. When the process executes and accesses those pages that reside in the memory, the execution runs normally.

But what happens when a process tries to access pages that have not been transferred to the memory? Page error traps are generated for access marked as invalid. Paging hardware, when converting the address through the page table, it will find that an invalid bit has been set and will be stuck in the operating system. This trap is caused by the failure of the operating system to transfer the required pages to memory (in an attempt to reduce disk transmission overhead and memory requirements), rather than an Invalid Address error caused by an attempt to use an invalid memory address. This negligence must be corrected.

1: Check the page table of the process (usually stored together with the PCB) to determine whether the reference is legal or illegal address access.

2: If drinking is illegal, terminate the process. If the reference is valid but has not been transferred to the page, you should call it now.

3: Find an idle frame.

4: Call a disk to transfer the required page to the allocated frame.

5: After the disk read operation is complete, modify the internal table and page table of the process to indicate that the page is already in memory.

6: restart the commands that are interrupted due to illegal address traps. The process can now access the desired page, as if it is always in memory.

Note that when an error occurs, the status of the interrupted process (register, conditional code, and instruction count) is saved. Therefore, the process can be re-executed at exactly the same location and address, however, the required pages are in memory and accessible.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.