docs
docs copied to clipboard
Incorrect information about pgfault & major pgfault
Is this a docs issue?
- [X] My issue is about the documentation content or website
Type of issue
Information is incorrect
Description
https://docs.docker.com/config/containers/runmetrics/
"""Indicate the number of times that a process of the cgroup triggered a "page fault" and a "major fault", respectively. A page fault happens when a process accesses a part of its virtual memory space which is nonexistent or protected. The former can happen if the process is buggy and tries to access an invalid address (it is sent a SIGSEGV signal, typically killing it with the famous Segmentation fault message). The latter can happen when the process reads from a memory zone which has been swapped out, or which corresponds to a mapped file: in that case, the kernel loads the page from disk, and let the CPU complete the memory access. It can also happen when the process writes to a copy-on-write memory zone: likewise, the kernel preempts the process, duplicate the memory page, and resume the write operation on the process's own copy of the page. "Major" faults happen when the kernel actually needs to read the data from disk. When it just duplicates an existing page, or allocate an empty page, it's a regular (or "minor") fault."""
This is an incorrect description of the statistics.
pgfault (npn) Total number of page faults incurred
pgmajfault (npn) Number of major page faults incurred
See: https://docs.kernel.org/admin-guide/cgroup-v2.html
The italicized portion is an incorrect and incomplete description.
page faults may be broken down into:
Minor: page is loaded in memory but is not immediately available through MMU. Major: page is not available and must be loaded from the block storage device. Invalid: page is not in virtual address space accessible by process. throws segmentation fault.
See https://dl.acm.org/doi/fullHtml/10.1145/3547142 and additional OS references (preferably kernel docs) for discussion of major and minor page faults.
Location
https://docs.docker.com/config/containers/runmetrics/
Suggestion
The documentation just needs to be corrected. I would be happy to contribute a correction for review if no one in org is able to.