eb7712
From cfd0231bfc49d6f040f9ec90243ae35e1af216d0 Mon Sep 17 00:00:00 2001
eb7712
From: =?UTF-8?q?Nikola=20Forr=C3=B3?= <nforro@redhat.com>
eb7712
Date: Wed, 22 Aug 2018 12:35:44 +0200
eb7712
Subject: [PATCH 2/2] proc.5: document missing fields in /proc/[pid]/smaps and
eb7712
 /proc/[pid]/status
eb7712
eb7712
---
eb7712
 man-pages/man5/proc.5 | 198 +++++++++++++++++++++++++++++++++++-------
eb7712
 1 file changed, 168 insertions(+), 30 deletions(-)
eb7712
eb7712
diff --git a/man-pages/man5/proc.5 b/man-pages/man5/proc.5
eb7712
index e4d2fd7..fa8505d 100644
eb7712
--- a/man-pages/man5/proc.5
eb7712
+++ b/man-pages/man5/proc.5
eb7712
@@ -961,28 +961,93 @@ For each of mappings there is a series of lines such as the following:
eb7712
 .in +4n
eb7712
 .nf
eb7712
 
eb7712
-08048000-080bc000 r-xp 00000000 03:02 13130      /bin/bash
eb7712
-Size:               464 kB
eb7712
-Rss:                424 kB
eb7712
-Shared_Clean:       424 kB
eb7712
-Shared_Dirty:         0 kB
eb7712
-Private_Clean:        0 kB
eb7712
-Private_Dirty:        0 kB
eb7712
+00400000\-0048a000 r\-xp 00000000 fd:03 960637       /bin/bash
eb7712
+Size:                552 kB
eb7712
+Rss:                 460 kB
eb7712
+Pss:                 100 kB
eb7712
+Shared_Clean:        452 kB
eb7712
+Shared_Dirty:          0 kB
eb7712
+Private_Clean:         8 kB
eb7712
+Private_Dirty:         0 kB
eb7712
+Referenced:          460 kB
eb7712
+Anonymous:             0 kB
eb7712
+AnonHugePages:         0 kB
eb7712
+Swap:                  0 kB
eb7712
+KernelPageSize:        4 kB
eb7712
+MMUPageSize:           4 kB
eb7712
+KernelPageSize:        4 kB
eb7712
+MMUPageSize:           4 kB
eb7712
+Locked:                0 kB
eb7712
+VmFlags: rd ex mr mw me dw
eb7712
 
eb7712
 .fi
eb7712
 .in
eb7712
 The first of these lines shows the same information as is displayed
eb7712
 for the mapping in
eb7712
 .IR /proc/[pid]/maps .
eb7712
-The remaining lines show the size of the mapping,
eb7712
-the amount of the mapping that is currently resident in RAM,
eb7712
+The following lines show the size of the mapping,
eb7712
+the amount of the mapping that is currently resident in RAM ("Rss"),
eb7712
+the process's proportional share of this mapping ("Pss"),
eb7712
 the number of clean and dirty shared pages in the mapping,
eb7712
 and the number of clean and dirty private pages in the mapping.
eb7712
-
eb7712
-This file is present only if the
eb7712
-.B CONFIG_MMU
eb7712
-kernel configuration
eb7712
-option is enabled.
eb7712
+"Referenced" indicates the amount of memory currently marked as
eb7712
+referenced or accessed.
eb7712
+"Anonymous" shows the amount of memory
eb7712
+that does not belong to any file.
eb7712
+"Swap" shows how much
eb7712
+would-be-anonymous memory is also used, but out on swap.
eb7712
+.IP
eb7712
+The "KernelPageSize" line (available since Linux 2.6.29)
eb7712
+is the page size used by the kernel to back the virtual memory area.
eb7712
+This matches the size used by the MMU in the majority of cases.
eb7712
+However, one counter-example occurs on PPC64 kernels
eb7712
+whereby a kernel using 64kB as a base page size may still use 4kB
eb7712
+pages for the MMU on older processors.
eb7712
+To distinguish the two attributes, the "MMUPageSize" line
eb7712
+(also available since Linux 2.6.29)
eb7712
+reports the page size used by the MMU.
eb7712
+.IP
eb7712
+The "Locked" indicates whether the mapping is locked in memory
eb7712
+or not.
eb7712
+.IP
eb7712
+The "VmFlags" line (available since Linux 3.8)
eb7712
+represents the kernel flags associated with the virtual memory area,
eb7712
+encoded using the following two-letter codes:
eb7712
+.IP
eb7712
+    rd  - readable
eb7712
+    wr  - writable
eb7712
+    ex  - executable
eb7712
+    sh  - shared
eb7712
+    mr  - may read
eb7712
+    mw  - may write
eb7712
+    me  - may execute
eb7712
+    ms  - may share
eb7712
+    gd  - stack segment grows down
eb7712
+    pf  - pure PFN range
eb7712
+    dw  - disabled write to the mapped file
eb7712
+    lo  - pages are locked in memory
eb7712
+    io  - memory mapped I/O area
eb7712
+    sr  - sequential read advise provided
eb7712
+    rr  - random read advise provided
eb7712
+    dc  - do not copy area on fork
eb7712
+    de  - do not expand area on remapping
eb7712
+    ac  - area is accountable
eb7712
+    nr  - swap space is not reserved for the area
eb7712
+    ht  - area uses huge tlb pages
eb7712
+    nl  - non-linear mapping
eb7712
+    ar  - architecture specific flag
eb7712
+    dd  - do not include area into core dump
eb7712
+    sd  - soft-dirty flag
eb7712
+    mm  - mixed map area
eb7712
+    hg  - huge page advise flag
eb7712
+    nh  - no-huge page advise flag
eb7712
+    mg  - mergeable advise flag
eb7712
+.IP
eb7712
+The
eb7712
+.IR /proc/[pid]/smaps
eb7712
+file is present only if the
eb7712
+.B CONFIG_PROC_PAGE_MONITOR
eb7712
+kernel configuration option is enabled.
eb7712
 .TP
eb7712
 .I /proc/[pid]/stat
eb7712
 Status information about the process.
eb7712
@@ -1300,25 +1365,31 @@ Here's an example:
eb7712
 
eb7712
 .RB "$" " cat /proc/$$/status"
eb7712
 Name:   bash
eb7712
+Umask:  0022
eb7712
 State:  S (sleeping)
eb7712
-Tgid:   3515
eb7712
-Pid:    3515
eb7712
-PPid:   3452
eb7712
+Tgid:   17248
eb7712
+Ngid:   0
eb7712
+Pid:    17248
eb7712
+PPid:   17200
eb7712
 TracerPid:      0
eb7712
 Uid:    1000    1000    1000    1000
eb7712
 Gid:    100     100     100     100
eb7712
 FDSize: 256
eb7712
 Groups: 16 33 100
eb7712
-VmPeak:     9136 kB
eb7712
-VmSize:     7896 kB
eb7712
+VmPeak:   131168 kB
eb7712
+VmSize:   131168 kB
eb7712
 VmLck:         0 kB
eb7712
-VmHWM:      7572 kB
eb7712
-VmRSS:      6316 kB
eb7712
-VmData:     5224 kB
eb7712
-VmStk:        88 kB
eb7712
-VmExe:       572 kB
eb7712
-VmLib:      1708 kB
eb7712
-VmPTE:        20 kB
eb7712
+VmPin:         0 kB
eb7712
+VmHWM:     13484 kB
eb7712
+VmRSS:     13484 kB
eb7712
+RssAnon:       10264 kB
eb7712
+RssFile:        3220 kB
eb7712
+RssShmem:          0 kB
eb7712
+VmData:    10332 kB
eb7712
+VmStk:       136 kB
eb7712
+VmExe:       992 kB
eb7712
+VmLib:      2104 kB
eb7712
+VmPTE:        76 kB
eb7712
 Threads:        1
eb7712
 SigQ:   0/3067
eb7712
 SigPnd: 0000000000000000
eb7712
@@ -1330,6 +1401,9 @@ CapInh: 0000000000000000
eb7712
 CapPrm: 0000000000000000
eb7712
 CapEff: 0000000000000000
eb7712
 CapBnd: ffffffffffffffff
eb7712
+CapAmb: 0000000000000000
eb7712
+Seccomp:        0
eb7712
+Speculation_Store_Bypass:       vulnerable
eb7712
 Cpus_allowed:   00000001
eb7712
 Cpus_allowed_list:      0
eb7712
 Mems_allowed:   1
eb7712
@@ -1345,6 +1419,11 @@ The fields are as follows:
eb7712
 .IR Name :
eb7712
 Command run by this process.
eb7712
 .IP *
eb7712
+.IR Umask :
eb7712
+Process umask, expressed in octal with a leading zero; see
eb7712
+.BR umask (2).
eb7712
+(Since Linux 4.7.)
eb7712
+.IP *
eb7712
 .IR State :
eb7712
 Current state of the process.
eb7712
 One of
eb7712
@@ -1360,6 +1439,9 @@ or
eb7712
 .IR Tgid :
eb7712
 Thread group ID (i.e., Process ID).
eb7712
 .IP *
eb7712
+.IR Ngid :
eb7712
+NUMA group ID (0 if none; since Linux 3.13).
eb7712
+.IP *
eb7712
 .IR Pid :
eb7712
 Thread ID (see
eb7712
 .BR gettid (2)).
eb7712
@@ -1371,7 +1453,7 @@ PID of parent process.
eb7712
 PID of process tracing this process (0 if not being traced).
eb7712
 .IP *
eb7712
 .IR Uid ", " Gid :
eb7712
-Real, effective, saved set, and file system UIDs (GIDs).
eb7712
+Real, effective, saved set, and filesystem UIDs (GIDs).
eb7712
 .IP *
eb7712
 .IR FDSize :
eb7712
 Number of file descriptor slots currently allocated.
eb7712
@@ -1387,13 +1469,43 @@ Virtual memory size.
eb7712
 .IP *
eb7712
 .IR VmLck :
eb7712
 Locked memory size (see
eb7712
-.BR mlock (3)).
eb7712
+.BR mlock (2)).
eb7712
+.IP *
eb7712
+.IR VmPin :
eb7712
+Pinned memory size
eb7712
+.\" commit bc3e53f682d93df677dbd5006a404722b3adfe18
eb7712
+(since Linux 3.2).
eb7712
+These are pages that can't be moved because something needs to
eb7712
+directly access physical memory.
eb7712
 .IP *
eb7712
 .IR VmHWM :
eb7712
 Peak resident set size ("high water mark").
eb7712
 .IP *
eb7712
 .IR VmRSS :
eb7712
 Resident set size.
eb7712
+Note that the value here is the sum of
eb7712
+.IR RssAnon ,
eb7712
+.IR RssFile ,
eb7712
+and
eb7712
+.IR RssShmem .
eb7712
+.IP *
eb7712
+.IR RssAnon :
eb7712
+Size of resident anonymous memory.
eb7712
+.\" commit bf9683d6990589390b5178dafe8fd06808869293
eb7712
+(since Linux 4.5).
eb7712
+.IP *
eb7712
+.IR RssFile :
eb7712
+Size of resident file mappings.
eb7712
+.\" commit bf9683d6990589390b5178dafe8fd06808869293
eb7712
+(since Linux 4.5).
eb7712
+.IP *
eb7712
+.IR RssShmem :
eb7712
+Size of resident shared memory (includes System V shared memory,
eb7712
+mappings from
eb7712
+.BR tmpfs (5),
eb7712
+and shared anonymous mappings).
eb7712
+.\" commit bf9683d6990589390b5178dafe8fd06808869293
eb7712
+(since Linux 4.5).
eb7712
 .IP *
eb7712
 .IR VmData ", " VmStk ", " VmExe :
eb7712
 Size of data, stack, and text segments.
eb7712
@@ -1435,9 +1547,35 @@ Masks of capabilities enabled in inheritable, permitted, and effective sets
eb7712
 .IP *
eb7712
 .IR CapBnd :
eb7712
 Capability Bounding set
eb7712
-(since kernel 2.6.26, see
eb7712
+(since Linux 2.6.26, see
eb7712
+.BR capabilities (7)).
eb7712
+.IP *
eb7712
+.IR CapAmb :
eb7712
+Ambient capability set
eb7712
+(since Linux 4.3, see
eb7712
 .BR capabilities (7)).
eb7712
 .IP *
eb7712
+.IR Seccomp :
eb7712
+.\" commit 2f4b3bf6b2318cfaa177ec5a802f4d8d6afbd816
eb7712
+Seccomp mode of the process
eb7712
+(since Linux 3.8, see
eb7712
+.BR seccomp (2)).
eb7712
+0 means
eb7712
+.BR SECCOMP_MODE_DISABLED ;
eb7712
+1 means
eb7712
+.BR SECCOMP_MODE_STRICT ;
eb7712
+2 means
eb7712
+.BR SECCOMP_MODE_FILTER .
eb7712
+This field is provided only if the kernel was built with the
eb7712
+.BR CONFIG_SECCOMP
eb7712
+kernel configuration option enabled.
eb7712
+.IP *
eb7712
+.IR Speculation_Store_Bypass :
eb7712
+.\" commit fae1fa0fc6cca8beee3ab8ed71d54f9a78fa3f64
eb7712
+Speculation flaw mitigation state
eb7712
+(since Linux 4.17, see
eb7712
+.BR prctl (2)).
eb7712
+.IP *
eb7712
 .IR Cpus_allowed :
eb7712
 Mask of CPUs on which this process may run
eb7712
 (since Linux 2.6.24, see
eb7712
@@ -1458,7 +1596,7 @@ Same as previous, but in "list format"
eb7712
 (since Linux 2.6.26, see
eb7712
 .BR cpuset (7)).
eb7712
 .IP *
eb7712
-.IR voluntary_context_switches ", " nonvoluntary_context_switches :
eb7712
+.IR voluntary_ctxt_switches ", " nonvoluntary_ctxt_switches :
eb7712
 Number of voluntary and involuntary context switches (since Linux 2.6.23).
eb7712
 .RE
eb7712
 .TP
eb7712
-- 
eb7712
2.17.1
eb7712