简体   繁体   English

处理器如何知道页面未映射到主内存中而是在后备存储中?

[英]How does a processor know that a page is not mapped in main memory but is in backing store?

In the X86 architecture how does a processor know that a page is not mapped in main memory but is in backing store, is their a flag in the page table entry that indicates that or is it only after the translation into physical address that the processor realizes the location of the Frame? 在X86体系结构中,处理器如何知道页面未映射到主内存中而是位于后备存储中,是它们在页表项中的标志,该标志指示是否仅在处理器转换为物理地址后才能实现框架的位置? In my understanding when the 'P' flag in the Page structure entry is set it indicates that a valid mapping for the logical address does not exist and a Page fault follows, in case when the mapping is present but the page is in backing store than also Page fault occurs and the page is swapped into memory and the page table entry modified. 根据我的理解,如果在页面结构条目中设置了“ P”标志,则表明该逻辑地址不存在有效的映射,并且在出现映射但页面位于后备存储的情况下出现了页面错误。还发生页面错误,页面被交换到内存中,并且页面表项被修改。

I think you are referring to a HARD page fault VS a SOFT page fault. 我认为您指的是HARD页面错误VS SOFT页面错误。 A hard page fault will be fired if: 如果出现以下情况,将引发硬页面错误:

  • P(resent) flag is not set / no entry in page table exists 未设置P(resent)标志/页表中不存在任何条目
  • User mode code is writing a read only memory 用户模式代码正在写入只读存储器
  • User mode code is accessing kernel memory 用户模式代码正在访问内核内存
  • Page entry reserve bits are corrupted. 页面条目保留位已损坏。

A soft page fault will fire if the page is present but is else ware in memory (maybe on a different working set or leaving the working set) 如果存在页面,但其他页面仍在内存中(可能在其他工作集上或离开工作集),则会触发软页面错误

http://blogs.technet.com/b/askperf/archive/2008/06/10/the-basics-of-page-faults.aspx http://en.wikipedia.org/wiki/Page_fault (minor vs major) http://blogs.technet.com/b/askperf/archive/2008/06/10/the-basics-of-page-faults.aspx http://en.wikipedia.org/wiki/Page_fault (次要vs主要)

hope this help :) 希望这个帮助:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 处理器如何知道断点? - How does the processor know the breakpoints? CPU如何知道来自IVT的中断处理程序是BIOS函数还是映射到内存中的子例程 - How does the CPU know if an interrupt handler from an IVT is a BIOS function or a subroutine mapped in memory 编译器如何“知道”如何将代码转换为特定于处理器的程序集? - How does a compiler “know” how to translate code into processor specific assembly? 处理器如何知道从堆栈中读取多少函数参数(x64) - How does processor know how much to read from the stack for function parameters (x64) 裸机 RISC-V CPU - 处理器如何知道从哪个地址开始获取指令? - Bare metal RISC-V CPU - how does the processor know which address to start fetching instructions from? 内存性能中的存储操作如何工作? - how does store operation in memory performance work? mov eax如何在内存中存储数据? - How does mov eax store data in memory? 返回地址寄存器如何在不将返回地址存储在堆栈上的处理器体系结构中工作? - How does a return address register work in a processor architecture that doesn't store the return address on the stack? 二进制可执行文件如何知道其在内存中的位置? - How does a binary executable know its location in memory? 程序计数器如何知道下一条指令在内存中的位置? - How does the program counter know where the next instruction is in memory?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM