Get the App
SLTechnology News&Howtos  ›  Development  › 

What is a page fault Page Fault

Shulou Source: shulou.com Published: 2022-06-02 19:14:14 10月04日 Update

The main content of this article is to explain "what is a missing page error Page Fault", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what is a missing page error Page Fault"!

Terminology agreement

VA:Virtual Address virtual address

PA:Physical Address physical address

MMU:Memory Manage Unit memory Management Unit

TLB:Translation Lookaside Buffer bypass fast table cache / address translation cache

PTE:Page Table Entry paging table entry

Lazy allocation of memory

Take the 32-bit Linux system as an example, each process has its own virtual address space of 4GB. According to the principle of locality, it is not necessary and impossible to allocate the physical address space of 4GB to each process.

The same is true for 64-bit systems, except that the range of spatial addressing is many times larger, and the virtual address space of the process is divided into several parts:

In fact, only when the program is used to look for the page frame corresponding to the virtual address in memory, it is possible to allocate it if it cannot be found, which is the lazy (delayed) allocation mechanism of memory.

For a running process, not all virtual addresses have corresponding pages in physical memory. The figure shows that some virtual addresses have corresponding physical pages:

The virtual address space is generally divided according to the fixed size of 4KB, and the physical memory can be set to different page sizes. Usually, the physical page size is the same as the virtual page size. This paper expands according to the physical page 4KB size.

After the previous analysis, we will be faced with a problem: how to accurately and quickly map virtual addresses to physical pages?

>

Tags: Memory address physics process error space storage query data allocation size permissions problem situation cache processing different reason capacity summary Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Shulou Tech Info Xiaomi Shulou Technology vpn