页面错误可能涉及也可能不涉及辅助存储访问以使该页面可用是什么意思

Tim*_*Tim 1 top virtual-memory

从联机帮助页 top

nMaj  --  Major Page Fault Count
           The number of major page faults that have occurred for a task.  A
           page fault occurs when a process attempts to read from or write
           to a virtual page that is not currently present in its address
           space.  **A major page fault is when auxiliary storage access is
           involved in making that page available.**

nMin  --  Minor Page Fault count
           The number of minor page faults that have occurred for a task.  A
           page fault occurs when a process attempts to read from or write
           to a virtual page that is not currently present in its address
           space.  **A minor page fault does not involve auxiliary storage
           access in making that page available.**
Run Code Online (Sandbox Code Playgroud)

如果我是对的,处理页面错误是将物理内存中缺少的所需数据从交换转移到物理内存。交换是存储的一部分,例如硬盘驱动器或 SSD。那么,页面错误在使该页面可用时可能会或可能不会涉及辅助存储访问是什么意思呢?

谢谢。

Ste*_*itt 6

只有主要页面错误涉及辅助存储(从磁盘读取,从交换或其他地方,例如在二进制中分页时)。

次要页面错误是无需从磁盘读取即可满足的错误:

  • 涉及已经映射到内存其他地方的数据的页面错误(例如可以在进程之间共享的内存)
  • 新分配内存的页面错误(在全零页面和写时复制分配上使用)
  • 在某些情况下,已标记为要调出但尚未调出的数据

(这并不详尽)。