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