1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
.\" Copyright (C) 1994, 1995, Daniel Quinlan <quinlan@yggdrasil.com>
.\" Copyright (C) 2002-2008, 2017, Michael Kerrisk <mtk.manpages@gmail.com>
.\" Copyright (C) 2023, Alejandro Colomar <alx@kernel.org>
.\"
.\" SPDX-License-Identifier: GPL-3.0-or-later
.\"
.TH proc_pid_pagemap 5 2024-05-02 "Linux man-pages 6.8"
.SH NAME
/proc/pid/pagemap \- mapping of virtual pages
.SH DESCRIPTION
.TP
.IR /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 64-bit value for each virtual page,
with the bits set as follows:
.RS
.TP
63
If set, the page is present in RAM.
.TP
62
If set, the page is in swap space
.TP
61 (since Linux 3.5)
The page is a file-mapped page or a shared anonymous page.
.TP
60\[en]58 (since Linux 3.11)
Zero
.\" Not quite true; see commit 541c237c0923f567c9c4cabb8a81635baadc713f
.TP
57 (since Linux 5.14)
If set, the page is write-protected through
.BR userfaultfd (2).
.TP
56 (since Linux 4.2)
.\" commit 77bb499bb60f4b79cca7d139c8041662860fcf87
.\" commit 83b4b0bb635eee2b8e075062e4e008d1bc110ed7
The page is exclusively mapped.
.TP
55 (since Linux 3.11)
PTE is soft-dirty
(see the kernel source file
.IR Documentation/admin\-guide/mm/soft\-dirty.rst ).
.TP
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
.I /proc/kpageflags
and
.IR /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.
.RE
.IP
Before Linux 3.11, bits 60\[en]55 were
used to encode the base-2 log of the page size.
.IP
To employ
.IR /proc/ pid /pagemap
efficiently, use
.IR /proc/ pid /maps
to determine which areas of memory are actually mapped and seek
to skip over unmapped regions.
.IP
The
.IR /proc/ pid /pagemap
file is present only if the
.B CONFIG_PROC_PAGE_MONITOR
kernel configuration option is enabled.
.IP
Permission to access this file is governed by a ptrace access mode
.B PTRACE_MODE_READ_FSCREDS
check; see
.BR ptrace (2).
.SH SEE ALSO
.BR proc (5)
|