Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Survey] Page Fault across platforms #1770

Open
shirou opened this issue Jan 3, 2025 · 1 comment
Open

[Survey] Page Fault across platforms #1770

shirou opened this issue Jan 3, 2025 · 1 comment
Assignees

Comments

@shirou
Copy link
Owner

shirou commented Jan 3, 2025

In #1769, @zmyzheng suggested introducing Total Page Fault to process.PageFaultStat. Before merging it, I would like to study Page Fault values across platforms and summarize the findings in this issue. Therefore, this issue will be updated as the investigation progresses.

About page fault

https://en.wikipedia.org/wiki/Page_fault

Linux

https://www.kernel.org/doc/Documentation/filesystems/proc.rst

  • MinorFaults (min_flt)
    • number of minor faults
  • MajorFaults (maj_flt)
    • number of major faults
  • ChildMinorFaults (cmin_flt)
    • number of minor faults with child's
  • ChildMajorFaults (cmaj_flt)
    • number of major faults with child's

Windows

In this circumstance, however, the missing data is identified as being located within an area of memory that cannot be paged out to disk.

related

https://techcommunity.microsoft.com/blog/askperf/the-basics-of-page-faults/373120

hard page fault requires disk access to occur, which could be the first access to contents in a file or accesses to memory blocks that were paged

  • (shirou): This means PageFaultCount is same as Major Fault in linux?

Darwin

FreeBSD

OpenBSD

Solaris

Table 65 List of vminfo Probes

  • as_fault
    • Fires whenever a fault is taken on a page and the fault is neither a protection fault nor a copy-on-write fault.
  • cow_fault
    • Fires whenever a copy-on-write fault is taken on a page. arg0 contains the number of pages that are created as a result of the copy-on-write.
  • kernel_asflt
    • Fires whenever a page fault is taken by the kernel on a page in its own address space. Whenever kernel_asflt fires, it will be immediately preceded by a firing of the as_fault probe.
  • maj_fault
    • Fires whenever a page fault is taken that results in I/O from a backing store or swap device. Whenever maj_fault fires, it will be immediately preceded by a firing of the pgin probe.
  • prot_fault
    • Fires whenever a page fault is taken due to a protection violation.
@shirou shirou self-assigned this Jan 3, 2025
@zmyzheng
Copy link
Contributor

zmyzheng commented Jan 3, 2025

Thanks @shirou for raising this discussion. Based on the last paragraph of the link,

The page fault counters in Performance Monitor do not distinguish between hard and soft faults.

Since Windows only exposes one type of PageFaults, I guess this PageFault is what the Performance Monitor uses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants