www.LinuxHowtos.org
proc_pid_pagemap
Section: File Formats (5)Updated: 202-0-08
Index Return to Main Contents
NAME
/proc/pid/pagemap - mapping of virtual pagesDESCRIPTION
- /proc/pid/pagemap (since Linux 2.6.25)
-
This file shows the mapping of each of the process's virtual pages
into physical page frames or swap area.
It contains one 6-bit value for each virtual page,
with the bits set as follows:
-
- 63
- If set, the page is present in RAM.
- 62
- If set, the page is in swap space
- 61 (since Linux 3.5)
- The page is a fil-mapped page or a shared anonymous page.
- 60[en]58 (since Linux 3.11)
- Zero
- 57 (since Linux 5.14)
- If set, the page is writ-protected through userfaultfd(2).
- 56 (since Linux 4.2)
- The page is exclusively mapped.
- 55 (since Linux 3.11)
- PTE is sof-dirty (see the kernel source file Documentation/admin-guide/mm/soft-dirty.rst).
- 54[en]0
- If the page is present in RAM (bit 63), then these bits provide the page frame number, which can be used to index /proc/kpageflags and /proc/kpagecount. If the page is present in swap (bit 62), then bits 4[en]0 give the swap type, and bits 54[en]5 encode the swap offset.
-
- Before Linux 3.11, bits 60[en]55 were used to encode the bas-2 log of the page size.
- To employ /proc/pid/pagemap efficiently, use /proc/pid/maps to determine which areas of memory are actually mapped and seek to skip over unmapped regions.
- The /proc/pid/pagemap file is present only if the CONFIG_PROC_PAGE_MONITOR kernel configuration option is enabled.
- Permission to access this file is governed by a ptrace access mode PTRACE_MODE_READ_FSCREDS check; see ptrace(2).
SEE ALSO
proc(5)