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

StackOverflow https://stackoverflow.com/questions/21211942

  •  29-09-2022
  •  | 
  •  

Question

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? 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.

Was it helpful?

Solution

I think you are referring to a HARD page fault VS a SOFT page fault. A hard page fault will be fired if:

  • P(resent) flag is not set / no entry in page table exists
  • 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)

hope this help :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top