Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
sau đó thêm một lần nữa. Tuy nhiên, có không nhiều lặp đi lặp lại làm việc (ít hơn một hướng dẫn hoàn chỉnh), và lặp đi lặp lại là cần thiết chỉ khi một lỗi trang xảy ra. Khó khăn lớn phát sinh khi một trong những hướng dẫn có thể sửa đổi một số địa điểm khác nhau. | 92 Demand Paging 323 then adding again. However there is not much repeated work less than one complete instruction and the repetition is necessary only when a page fault occurs. The major difficulty arises when one instruction may modify several different locations. For example consider the IBM System 360 370 MVC move character instruction. which can move up to 256 bytes from one location to another possibly overlapping location. If either block source or destination straddles a page boundary a page fault might occur after the move is partially done. In addition if the source and destination blocks overlap the source block may have been modified in which case we cannot simply restart the instruction. This problem can be solved in two different ways. In one solution the microcode computes and attempts to access both ends ofboth blocks. If a page fault is going to occur it will happen at this step before anything is modified. The move can then take place we know that no page fault can occur since all the relevant pages are in memory. The other solution uses temporary registers to hold the values of overwritten locations. If there is a page fault all the old values are written back into memory before the trap occurs. This action restores memory to its state before the instruction was started so that the instruction can be repeated. This is by no means the only architectural problem resulting from adding paging to an existing architecture to allow demand paging but it illustrates some of the difficulties involved. Paging is added between the CPU and the memory in a computer system. It should be entirely transparent to the user process. Thus people often assume that paging can be added to any system. Although this assumption is true for a non-demand-paging environment where a page fault represents a fatal error it is not true where a page fault means only that an additional page must be brought into memory and the process restarted. 9.2.2 Performance of Demand Paging .