Andries Brouwer. the Linux Kernel: Memory
페이지 정보
작성자 Tayla Houtz 작성일25-11-03 15:12 조회41회 댓글0건관련링크
본문
In computer working techniques, memory paging is a memory management scheme that enables the bodily memory used by a program to be non-contiguous. This additionally helps avoid the issue of Memory Wave fragmentation and requiring compaction to reduce fragmentation. For historical reasons, this method is sometimes known as swapping. When mixed with virtual memory, it is named paged digital memory. On this scheme, the operating system retrieves knowledge from secondary storage in blocks of the identical dimension (pages). Paging is a crucial a part of digital Memory Wave Program implementations in modern working systems, using secondary storage to let applications exceed the dimensions of available bodily memory. Hardware help is important for environment friendly translation of logical addresses to bodily addresses. As such, paged memory functionality is usually hardwired right into a CPU through its Memory Management Unit (MMU) or Memory Protection Unit (MPU), and individually enabled by privileged system code in the working system's kernel.
In CPUs implementing the x86 instruction set architecture (ISA) as an example, the memory paging is enabled via the CR0 control register. In the 1960s, swapping was an early virtual memory technique. A complete program or entire segment could be "swapped out" (or "rolled out") from RAM to disk or drum, and another one could be swapped in (or rolled in). A swapped-out program could be current however its execution can be suspended whereas its RAM was in use by another program; a program with a swapped-out segment could proceed working till it wanted that section, at which level it could be suspended until the phase was swapped in. A program would possibly include a number of overlays that occupy the identical memory at totally different times. RAM use. Subsequent architectures used memory segmentation, and particular person program segments became the items exchanged between secondary storage and RAM. A section was this system's whole code segment or data phase, or generally different massive information structures. These segments needed to be contiguous when resident in RAM, requiring further computation and movement to remedy fragmentation.
1962), was the first system to implement memory paging. RAM as a seemingly contiguous logical address area. When a process tries to reference a page not at present mapped to a page body in RAM, the processor treats this invalid memory reference as a web page fault and transfers control from the program to the working system. 1. Decide whether a stolen page frame still comprises an unmodified copy of the web page; if that's the case, use that web page frame. Load the required data into the available page body. 3. Replace the web page desk to confer with the brand new web page body. 4. Return management to the program, transparently retrying the instruction that brought about the page fault. When all web page frames are in use, the working system must select a page body to reuse for the web page the program now needs. If the evicted web page frame was dynamically allotted by a program to carry data, or if a program modified it since it was read into RAM (in different phrases, if it has change into "dirty"), it must be written out to secondary storage earlier than being freed.
If a program later references the evicted page, one other web page fault happens and the page should be read again into RAM. The method the working system uses to select the web page body to reuse, which is its web page replacement algorithm, affects effectivity. The operating system predicts the web page frame least prone to be wanted quickly, often by the least lately used (LRU) algorithm or an algorithm primarily based on this system's working set. To further improve responsiveness, paging methods may predict which pages can be needed quickly, preemptively loading them into RAM earlier than a program references them, and may steal page frames from pages which have been unreferenced for a very long time, making them obtainable. Some systems clear new pages to avoid information leaks that compromise safety; some set them to installation outlined or random values to aid debugging. When pure demand paging is used, pages are loaded only when they are referenced. A program from a memory mapped file begins execution with none of its pages in RAM.
댓글목록
등록된 댓글이 없습니다.
