]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man5/proc.5
pldd.1, bpf.2, chdir.2, clone.2, fanotify_init.2, fanotify_mark.2, intro.2, ipc.2...
[thirdparty/man-pages.git] / man5 / proc.5
index 95590d7a5baf22499d6170a5c4e794bca2331767..ccce489c8a90062083b8156ed77c40e0abd54ac6 100644 (file)
@@ -1,5 +1,5 @@
 .\" Copyright (C) 1994, 1995 by Daniel Quinlan (quinlan@yggdrasil.com)
-.\" and Copyright (C) 2002-2008 Michael Kerrisk <mtk.manpages@gmail.com>
+.\" and Copyright (C) 2002-2008,2017 Michael Kerrisk <mtk.manpages@gmail.com>
 .\" with networking additions from Alan Cox (A.Cox@swansea.ac.uk)
 .\" and scsi additions from Michael Neuffer (neuffer@mail.uni-mainz.de)
 .\" and sysctl additions from Andries Brouwer (aeb@cwi.nl)
@@ -52,7 +52,7 @@
 .\" to see what information could be imported from that file
 .\" into this file.
 .\"
-.TH PROC 5 2017-09-15 "Linux" "Linux Programmer's Manual"
+.TH PROC 5 2019-08-02 "Linux" "Linux Programmer's Manual"
 .SH NAME
 proc \- process information pseudo-filesystem
 .SH DESCRIPTION
@@ -153,25 +153,115 @@ This group should be used instead of approaches such as putting
 nonroot users into the
 .BR sudoers (5)
 file.
+.\"
+.SS Overview
+Underneath
+.IR /proc ,
+there are the following general groups of files and subdirectories:
+.TP
+.IR /proc/[pid] " subdirectories"
+Each one of these subdirectories contains files and subdirectories
+exposing information about the process with the corresponding process ID.
+.IP
+Underneath each of the
+.I /proc/[pid]
+directories, a
+.I task
+subdirectory contains subdirectories of the form
+.IR task/[tid] ,
+which contain corresponding information about each of the threads
+in the process, where
+.I tid
+is the kernel thread ID of the thread.
+.IP
+The
+.I /proc/[pid]
+subdirectories are visible when iterating through
+.I /proc
+with
+.BR getdents (2)
+(and thus are visible when one uses
+.BR ls (1)
+to view the contents of
+.IR /proc ).
+.TP
+.IR /proc/[tid] " subdirectories"
+Each one of these subdirectories contains files and subdirectories
+exposing information about the thread with the corresponding thread ID.
+The contents of these directories are the same as the corresponding
+.IR /proc/[pid]/task/[tid]
+directories.
+.IP
+The
+.I /proc/[tid]
+subdirectories are
+.I not
+visible when iterating through
+.I /proc
+with
+.BR getdents (2)
+(and thus are
+.I not
+visible when one uses
+.BR ls (1)
+to view the contents of
+.IR /proc ).
+.TP
+.I /proc/self
+When a process accesses this magic symbolic link,
+it resolves to the process's own
+.I /proc/[pid]
+directory.
+.TP
+.I /proc/thread-self
+When a thread accesses this magic symbolic link,
+it resolves to the process's own
+.I /proc/self/task/[tid]
+directory.
+.TP
+.I /proc/[a-z]*
+Various other files and subdirectories under
+.I /proc
+expose system-wide information.
+.PP
+All of the above are described in more detail below.
+.\"
 .SS Files and directories
-The following list describes many of the files and directories under the
+The following list provides details of many of the files and directories
+under the
 .I /proc
 hierarchy.
 .TP
 .I /proc/[pid]
 There is a numerical subdirectory for each running process; the
 subdirectory is named by the process ID.
-.IP
 Each
 .I /proc/[pid]
-subdirectory contains the
-pseudo-files and directories described below.
-These files are normally owned by the effective user and
+subdirectory contains the pseudo-files and directories described below.
+.IP
+The files inside each
+.I /proc/[pid]
+directory are normally owned by the effective user and
 effective group ID of the process.
 However, as a security measure, the ownership is made
 .IR root:root
 if the process's "dumpable" attribute is set to a value other than 1.
-This attribute may change for the following reasons:
+.IP
+Before Linux 4.11,
+.\" commit 68eb94f16227336a5773b83ecfa8290f1d6b78ce
+.IR root:root
+meant the "global" root user ID and group ID
+(i.e., UID 0 and GID 0 in the initial user namespace).
+Since Linux 4.11,
+if the process is in a noninitial user namespace that has a
+valid mapping for user (group) ID 0 inside the namespace, then
+the user (group) ownership of the files under
+.I /proc/[pid]
+is instead made the same as the root user (group) ID of the namespace.
+This means that inside a container,
+things work as expected for the container "root" user.
+.IP
+The process's "dumpable" attribute may change for the following reasons:
 .RS
 .IP * 3
 The attribute was explicitly set via the
@@ -187,7 +277,7 @@ The attribute was reset to the value in the file
 .IP
 Resetting the "dumpable" attribute to 1 reverts the ownership of the
 .IR /proc/[pid]/*
-files to the process's real UID and real GID.
+files to the process's effective UID and GID.
 .TP
 .I /proc/[pid]/attr
 .\" https://lwn.net/Articles/28222/
@@ -227,6 +317,7 @@ Since Linux 2.6.11, SELinux lifted this restriction and began supporting
 although use of this operation is only suitable for applications that are
 trusted to maintain any desired separation between the old and new security
 contexts.
+.IP
 Prior to Linux 2.6.28, SELinux did not allow threads within a
 multi-threaded process to set their security context via this node
 as it would yield an inconsistency among the security contexts of the
@@ -237,6 +328,7 @@ a multithreaded process if the new security context is bounded by the old
 security context, where the bounded relation is defined in policy and
 guarantees that the new security context has a subset of the permissions
 of the old security context.
+.IP
 Other security modules may choose to support "set" operations via
 writes to this node.
 .TP
@@ -317,7 +409,8 @@ all subsequently created sockets will be labeled with this context.
 See
 .BR sched (7).
 .TP
-.IR /proc/[pid]/auxv " (since 2.6.0-test7)"
+.IR /proc/[pid]/auxv " (since 2.6.0)"
+.\" Precisely: Linux 2.6.0-test7
 This contains the contents of the ELF interpreter information passed
 to the process at exec time.
 The format is one \fIunsigned long\fP ID
@@ -417,7 +510,7 @@ unless the process is a zombie.
 In the latter case, there is nothing in this file:
 that is, a read on this file will return 0 characters.
 The command-line arguments appear in this file as a set of
-strings separated by null bytes (\(aq\\0\(aq),
+strings separated by null bytes (\(aq\e0\(aq),
 with a further null byte after the last string.
 .TP
 .IR /proc/[pid]/comm " (since Linux 2.6.33)"
@@ -497,13 +590,13 @@ check; see
 This file contains the initial environment that was set
 when the currently executing program was started via
 .BR execve (2).
-The entries are separated by null bytes (\(aq\\0\(aq),
+The entries are separated by null bytes (\(aq\e0\(aq),
 and there may be a null byte at the end.
 Thus, to print out the environment of process 1, you would do:
 .IP
 .in +4n
 .EX
-.RB "$" " strings /proc/1/environ"
+.RB "$" " cat /proc/1/environ | tr \(aq\e000\(aq \(aq\en\(aq"
 .EE
 .in
 .IP
@@ -671,7 +764,7 @@ and
 in
 .IR /proc/self/fd .
 Thus the example command above could be written as:
-.PP
+.IP
 .in +4n
 .EX
 .RB "$" " foobar \-i /dev/stdin \-o /dev/stdout ..."
@@ -684,6 +777,31 @@ the symbolic links in this directory is governed by a ptrace access mode
 .B PTRACE_MODE_READ_FSCREDS
 check; see
 .BR ptrace (2).
+.IP
+Note that for file descriptors referring to inodes (pipes and sockets, see above),
+those inodes still have permission bits and ownership information
+distinct from those of the
+.I /proc/[pid]/fd
+entry,
+and that the owner may differ from the user and group IDs of the process.
+An unprivileged process may lack permissions to open them, as in this example:
+.IP
+.in +4n
+.EX
+.RB "$" " echo test | sudo -u nobody cat"
+test
+.RB "$" " echo test | sudo -u nobody cat /proc/self/fd/0"
+cat: /proc/self/fd/0: Permission denied
+.EE
+.in
+.IP
+File descriptor 0 refers to the pipe created by the shell
+and owned by that shell's user, which is not
+.IR nobody ,
+so
+.B cat
+does not have permission to create a new file descriptor to read from that inode,
+even though it can still read from its existing file descriptor 0.
 .TP
 .IR /proc/[pid]/fdinfo/ " (since Linux 2.6.22)"
 This is a subdirectory containing one entry for each file which the
@@ -907,6 +1025,71 @@ The mask of events that are ignored for this mark
 .IP
 For details on these fields, see
 .BR fanotify_mark (2).
+.IP
+For timerfd file descriptors (see
+.BR timerfd (2)),
+we see (since Linux 3.17)
+.\" commit af9c4957cf212ad9cf0bee34c95cb11de5426e85
+the following fields:
+.IP
+.in +4n
+.EX
+pos:    0
+flags:  02004002
+mnt_id: 13
+clockid: 0
+ticks: 0
+settime flags: 03
+it_value: (7695568592, 640020877)
+it_interval: (0, 0)
+.EE
+.in
+.RS
+.TP
+.I clockid
+This is the numeric value of the clock ID
+(corresponding to one of the
+.B CLOCK_*
+constants defined via
+.IR <time.h> )
+that is used to mark the progress of the timer (in this example, 0 is
+.BR CLOCK_REALTIME ).
+.TP
+.I ticks
+This is the number of timer expirations that have occurred,
+(i.e., the value that
+.BR read (2)
+on it would return).
+.TP
+.I settime flags
+This field lists the flags with which the timerfd was last armed (see
+.BR timerfd_settime (2)),
+in octal
+(in this example, both
+.B TFD_TIMER_ABSTIME
+and
+.B TFD_TIMER_CANCEL_ON_SET
+are set).
+.TP
+.I it_value
+This field contains the amount of time until the timer will next expire,
+expressed in seconds and nanoseconds.
+This is always expressed as a relative value,
+regardless of whether the timer was created using the
+.B TFD_TIMER_ABSTIME
+flag.
+.TP
+.I it_interval
+This field contains the interval of the timer,
+in seconds and nanoseconds.
+(The
+.I it_value
+and
+.I it_interval
+fields contain the values that
+.BR timerfd_gettime (2)
+on this file descriptor would return.)
+.RE
 .TP
 .IR /proc/[pid]/gid_map " (since Linux 3.5)"
 See
@@ -1143,14 +1326,17 @@ There are additional helpful pseudo-paths:
 .IR [stack]
 The initial process's (also known as the main thread's) stack.
 .TP
-.IR [stack:<tid>] " (since Linux 3.4)"
-.\" commit b76437579d1344b612cf1851ae610c636cec7db0
+.IR [stack:<tid>] " (from Linux 3.4 to 4.4)"
+.\" commit b76437579d1344b612cf1851ae610c636cec7db0 (added)
+.\" commit 65376df582174ffcec9e6471bf5b0dd79ba05e4a (removed)
 A thread's stack (where the
 .IR <tid>
 is a thread ID).
 It corresponds to the
 .IR /proc/[pid]/task/[tid]/
 path.
+This field was removed in Linux 4.5, since providing this information
+for a process with large numbers of threads is expensive.
 .TP
 .IR [vdso]
 The virtual dynamically linked shared object.
@@ -1173,6 +1359,18 @@ short of running it through
 .BR strace (1),
 or similar.
 .IP
+.I pathname
+is shown unescaped except for newline characters, which are replaced
+with an octal escape sequence.
+As a result, it is not possible to determine whether the original
+pathname contained a newline character or the literal
+.I \ee012
+character sequence.
+.IP
+If the mapping is file-backed and the file has been deleted, the string
+" (deleted)" is appended to the pathname.
+Note that this is ambiguous too.
+.IP
 Under Linux 2.0, there is no field giving pathname.
 .TP
 .I /proc/[pid]/mem
@@ -1219,7 +1417,34 @@ mount ID: a unique ID for the mount (may be reused after
 .TP
 (2)
 parent ID: the ID of the parent mount
-(or of self for the top of the mount tree).
+(or of self for the root of this mount namespace's mount tree).
+.IP
+If a new mount is stacked on top of a previous existing mount
+(so that it hides the existing mount) at pathname P,
+then the parent of the new mount is the previous mount at that location.
+Thus, when looking at all the mounts stacked at a particular location,
+the top-most mount is the one that is not the parent
+of any other mount at the same location.
+(Note, however, that this top-most mount will be accessible only if
+the longest path subprefix of P that is a mount point
+is not itself hidden by a stacked mount.)
+.IP
+If the parent mount point lies outside the process's root directory (see
+.BR chroot (2)),
+the ID shown here won't have a corresponding record in
+.I mountinfo
+whose mount ID (field 1) matches this parent mount ID
+(because mount points that lie outside the process's root directory
+are not shown in
+.IR mountinfo ).
+As a special case of this point,
+the process's root mount point may have a parent mount
+(for the initramfs filesystem) that lies
+.\" Miklos Szeredi, Nov 2017: The hidden one is the initramfs, I believe
+.\" mtk: In the initial mount namespace, this hidden ID has the value 0
+outside the process's root directory,
+and an entry for that mount point will not appear in
+.IR mountinfo .
 .TP
 (3)
 major:minor: the value of
@@ -1236,7 +1461,8 @@ mount point: the pathname of the mount point relative
 to the process's root directory.
 .TP
 (6)
-mount options: per-mount options.
+mount options: per-mount options (see
+.BR mount (2)).
 .TP
 (7)
 optional fields: zero or more fields of the form "tag[:value]"; see below.
@@ -1251,7 +1477,8 @@ filesystem type: the filesystem type in the form "type[.subtype]".
 mount source: filesystem-specific information or "none".
 .TP
 (11)
-super options: per-superblock options.
+super options: per-superblock options (see
+.BR mount (2)).
 .RE
 .IP
 Currently, the possible optional fields are
@@ -1370,7 +1597,9 @@ Since Linux 2.6.36, use of this file is deprecated in favor of
 .IR /proc/[pid]/oom_score_adj .
 .TP
 .IR /proc/[pid]/oom_score " (since Linux 2.6.11)"
-.\" See mm/oom_kill.c::badness() in the 2.6.25 sources
+.\" See mm/oom_kill.c::badness() in pre 2.6.36 sources
+.\" See mm/oom_kill.c::oom_badness() after 2.6.36
+.\" commit a63d83f427fbce97a6cea0db2e64b0eb8435cd10
 This file displays the current score that the kernel gives to
 this process for the purpose of selecting a process
 for the OOM-killer.
@@ -1378,7 +1607,16 @@ A higher score means that the process is more likely to be
 selected by the OOM-killer.
 The basis for this score is the amount of memory used by the process,
 with increases (+) or decreases (\-) for factors including:
-.\" See mm/oom_kill.c::badness() in the 2.6.25 sources
+.\" See mm/oom_kill.c::badness() in pre 2.6.36 sources
+.\" See mm/oom_kill.c::oom_badness() after 2.6.36
+.\" commit a63d83f427fbce97a6cea0db2e64b0eb8435cd10
+.RS
+.IP * 2
+whether the process is privileged (\-).
+.\" More precisely, if it has CAP_SYS_ADMIN or (pre 2.6.36) CAP_SYS_RESOURCE
+.RE
+.IP
+Before kernel 2.6.36 the following factors were also used in the calculation of oom_score:
 .RS
 .IP * 2
 whether the process creates a lot of children using
@@ -1388,10 +1626,7 @@ whether the process creates a lot of children using
 whether the process has been running a long time,
 or has used a lot of CPU time (\-);
 .IP *
-whether the process has a low nice value (i.e., > 0) (+);
-.IP *
-whether the process is privileged (\-); and
-.\" More precisely, if it has CAP_SYS_ADMIN or CAP_SYS_RESOURCE
+whether the process has a low nice value (i.e., > 0) (+); and
 .IP *
 whether the process is making direct hardware access (\-).
 .\" More precisely, if it has CAP_SYS_RAWIO
@@ -1473,6 +1708,12 @@ Writing to
 or
 .IR /proc/[pid]/oom_adj
 will change the other with its scaled value.
+.IP
+The
+.BR choom (1)
+program provides a command-line interface for adjusting the
+.I oom_score_adj
+value of a running process or a newly executed command.
 .TP
 .IR /proc/[pid]/pagemap " (since Linux 2.6.25)"
 This file shows the mapping of each of the process's virtual pages
@@ -1502,7 +1743,7 @@ The page is exclusively mapped.
 55 (since Linux 3.11)
 PTE is soft-dirty
 (see the kernel source file
-.IR Documentation/vm/soft-dirty.txt ).
+.IR Documentation/admin-guide/mm/soft-dirty.rst ).
 .TP
 54\(en0
 If the page is present in RAM (bit 63), then these bits
@@ -2198,6 +2439,7 @@ VmPTE:          76 kB
 VmPMD:       12 kB
 VmSwap:               0 kB
 HugetlbPages:          0 kB            # 4.4
+CoreDumping:   0                       # 4.15
 Threads:        1
 SigQ:   0/3067
 SigPnd: 0000000000000000
@@ -2212,6 +2454,7 @@ CapBnd: ffffffffffffffff
 CapAmb:        0000000000000000
 NoNewPrivs:     0
 Seccomp:        0
+Speculation_Store_Bypass:       vulnerable
 Cpus_allowed:   00000001
 Cpus_allowed_list:      0
 Mems_allowed:   1
@@ -2269,17 +2512,18 @@ Number of file descriptor slots currently allocated.
 .IR Groups :
 Supplementary group list.
 .IP *
-.I NStgid :
+.IR NStgid :
 Thread group ID (i.e., PID) in each of the PID namespaces of which
 .I [pid]
 is a member.
 The leftmost entry shows the value with respect to the PID namespace
-of the reading process,
+of the process that mounted this procfs (or the root namespace
+if mounted by the kernel),
 followed by the value in successively nested inner namespaces.
 .\" commit e4bc33245124db69b74a6d853ac76c2976f472d5
 (Since Linux 4.1.)
 .IP *
-.IR NSpid:
+.IR NSpid :
 Thread ID in each of the PID namespaces of which
 .I [pid]
 is a member.
@@ -2312,7 +2556,7 @@ Virtual memory size.
 .IP *
 .IR VmLck :
 Locked memory size (see
-.BR mlock (3)).
+.BR mlock (2)).
 .IP *
 .IR VmPin :
 Pinned memory size
@@ -2361,7 +2605,7 @@ Page table entries size (since Linux 2.6.10).
 .IP *
 .IR VmPMD :
 .\" commit dc6c9a35b66b520cf67e05d8ca60ebecad3b0479
-Size of second-level page tables (since Linux 4.0).
+Size of second-level page tables (added in Linux 4.0; removed in Linux 4.15).
 .IP *
 .IR VmSwap :
 .\" commit b084d4353ff99d824d3bc5a5c2c22c70b1fba722
@@ -2369,10 +2613,19 @@ Swapped-out virtual memory size by anonymous private pages;
 shmem swap usage is not included (since Linux 2.6.34).
 .IP *
 .IR HugetlbPages :
-Size of hugetlb memory portions.
+Size of hugetlb memory portions
 .\" commit 5d317b2b6536592a9b51fe65faed43d65ca9158e
 (since Linux 4.4).
 .IP *
+.IR CoreDumping :
+Contains the value 1 if the process is currently dumping core,
+and 0 if it is not
+.\" commit c643401218be0f4ab3522e0c0a63016596d6e9ca
+(since Linux 4.15).
+This information can be used by a monitoring process to avoid killing
+a process that is currently dumping core,
+which could result in a corrupted core dump file.
+.IP *
 .IR Threads :
 Number of threads in process containing this thread.
 .IP *
@@ -2388,27 +2641,30 @@ in
 .BR getrlimit (2)).
 .IP *
 .IR SigPnd ", " ShdPnd :
-Number of signals pending for thread and for process as a whole (see
+ Mask (expressed in hexadecomal)
+of signals pending for thread and for process as a whole (see
 .BR pthreads (7)
 and
 .BR signal (7)).
 .IP *
 .IR SigBlk ", " SigIgn ", " SigCgt :
-Masks indicating signals being blocked, ignored, and caught (see
+Masks (expressed in hexadeximal)
+indicating signals being blocked, ignored, and caught (see
 .BR signal (7)).
 .IP *
 .IR CapInh ", " CapPrm ", " CapEff :
-Masks of capabilities enabled in inheritable, permitted, and effective sets
+Masks (expressed in hexadeximal)
+of capabilities enabled in inheritable, permitted, and effective sets
 (see
 .BR capabilities (7)).
 .IP *
 .IR CapBnd :
-Capability Bounding set
+Capability bounding set, expressed in hexadecimal
 (since Linux 2.6.26, see
 .BR capabilities (7)).
 .IP *
 .IR CapAmb :
-Ambient capability set
+Ambient capability set, expressed in hexadecimal
 (since Linux 4.3, see
 .BR capabilities (7)).
 .IP *
@@ -2435,8 +2691,14 @@ This field is provided only if the kernel was built with the
 .BR CONFIG_SECCOMP
 kernel configuration option enabled.
 .IP *
+.IR Speculation_Store_Bypass :
+.\" commit fae1fa0fc6cca8beee3ab8ed71d54f9a78fa3f64
+Speculation flaw mitigation state
+(since Linux 4.17, see
+.BR prctl (2)).
+.IP *
 .IR Cpus_allowed :
-Mask of CPUs on which this process may run
+Hexadecimal mask of CPUs on which this process may run
 (since Linux 2.6.24, see
 .BR cpuset (7)).
 .IP *
@@ -2480,13 +2742,15 @@ Permission to access this file is governed by a ptrace access mode
 check; see
 .BR ptrace (2).
 .TP
-.IR /proc/[pid]/task " (since Linux 2.6.0-test6)"
+.IR /proc/[pid]/task " (since Linux 2.6.0)"
+.\" Precisely: Linux 2.6.0-test6
 This is a directory that contains one subdirectory
 for each thread in the process.
 The name of each subdirectory is the numerical thread ID
 .RI ( [tid] )
 of the thread (see
 .BR gettid (2)).
+.IP
 Within each of these subdirectories, there is a set of
 files with the same names and contents as under the
 .I /proc/[pid]
@@ -2514,6 +2778,7 @@ files may be different for each thread),
 or they might not exist in
 .I /proc/[pid]
 at all.
+.IP
 .\" The following was still true as at kernel 2.6.13
 In a multithreaded process, the contents of the
 .I /proc/[pid]/task
@@ -2659,6 +2924,36 @@ Permission to access this file is governed by a ptrace access mode
 check; see
 .BR ptrace (2).
 .TP
+.IR /proc/[tid]
+There  is a numerical subdirectory for each running thread
+that is not a thread group leader
+(i.e., a thread whose thread ID is not the same as its process ID);
+the subdirectory is named by the thread ID.
+Each one of these subdirectories contains files and subdirectories
+exposing information about the thread with the thread ID
+.IR tid .
+The contents of these directories are the same as the corresponding
+.IR /proc/[pid]/task/[tid]
+directories.
+.IP
+The
+.I /proc/[tid]
+subdirectories are
+.I not
+visible when iterating through
+.I /proc
+with
+.BR getdents (2)
+(and thus are
+.I not
+visible when one uses
+.BR ls (1)
+to view the contents of
+.IR /proc ).
+However, the pathnames of these directories are visible to
+(i.e., usable as arguments in)
+system calls that operate on pathnames.
+.TP
 .I /proc/apm
 Advanced power management version and battery information when
 .B CONFIG_APM
@@ -2683,7 +2978,7 @@ a higher order (thus with double the size) to satisfy allocation
 requests and to counter memory fragmentation.
 The order matches the column number, when starting to count at zero.
 .IP
-For example on a x86-64 system:
+For example on an x86-64 system:
 .IP
 .in -12n
 .EX
@@ -2992,7 +3287,7 @@ The bits are as follows:
 .IP
 For further details on the meanings of these bits,
 see the kernel source file
-.IR Documentation/vm/pagemap.txt .
+.IR Documentation/admin-guide/mm/pagemap.rst .
 Before kernel 2.6.29,
 .\" commit ad3bdefe877afb47480418fdb05ecd42842de65e
 .\" commit e07a4b9217d1e97d2f3a62b6b070efdc61212110
@@ -3033,6 +3328,103 @@ This file shows current file locks
 .RB ( flock "(2) and " fcntl (2))
 and leases
 .RB ( fcntl (2)).
+.IP
+An example of the content shown in this file is the following:
+.IP
+.in +4n
+.EX
+1: POSIX  ADVISORY  READ  5433 08:01:7864448 128 128
+2: FLOCK  ADVISORY  WRITE 2001 08:01:7864554 0 EOF
+3: FLOCK  ADVISORY  WRITE 1568 00:2f:32388 0 EOF
+4: POSIX  ADVISORY  WRITE 699 00:16:28457 0 EOF
+5: POSIX  ADVISORY  WRITE 764 00:16:21448 0 0
+6: POSIX  ADVISORY  READ  3548 08:01:7867240 1 1
+7: POSIX  ADVISORY  READ  3548 08:01:7865567 1826 2335
+8: OFDLCK ADVISORY  WRITE -1 08:01:8713209 128 191
+.EE
+.in
+.IP
+The fields shown in each line are as follows:
+.RS
+.IP (1) 4
+The ordinal position of the lock in the list.
+.IP (2)
+The lock type.
+Values that may appear here include:
+.RS
+.TP
+.B FLOCK
+This is a BSD file lock created using
+.BR flock (2).
+.TP
+.B OFDLCK
+This is an open file description (OFD) lock created using
+.BR fcntl (2).
+.TP
+.B POSIX
+This is a POSIX byte-range lock created using
+.BR fcntl (2).
+.RE
+.IP (3)
+Among the strings that can appear here are the following:
+.RS
+.TP
+.B ADVISORY
+This is an advisory lock.
+.TP
+.B MANDATORY
+This is a mandatory lock.
+.RE
+.IP (4)
+The type of lock.
+Values that can appear here are:
+.RS
+.TP
+.B READ
+This is a POSIX or OFD read lock, or a BSD shared lock.
+.TP
+.B WRITE
+This is a POSIX or OFD write lock, or a BSD exclusive lock.
+.RE
+.IP (5)
+The PID of the process that owns the lock.
+.IP
+Because OFD locks are not owned by a single process
+(since multiple processes may have file descriptors that
+refer to the same open file description),
+the value \-1 is displayed in this field for OFD locks.
+(Before kernel 4.14,
+.\" commit 9d5b86ac13c573795525ecac6ed2db39ab23e2a8
+a bug meant that the PID of the process that
+initially acquired the lock was displayed instead of the value \-1.)
+.IP (6)
+Three colon-separated subfields that identify the major and minor device
+ID of the device containing the filesystem where the locked file resides,
+followed by the inode number of the locked file.
+.IP (7)
+The byte offset of the first byte of the lock.
+For BSD locks, this value is always 0.
+.IP (8)
+The byte offset of the last byte of the lock.
+.B EOF
+in this field means that the lock extends to the end of the file.
+For BSD locks, the value shown is always
+.IR EOF .
+.RE
+.IP
+Since Linux 4.9,
+.\" commit d67fd44f697dff293d7cdc29af929241b669affe
+the list of locks shown in
+.I /proc/locks
+is filtered to show just the locks for the processes in the PID
+namespace (see
+.BR pid_namespaces (7))
+for which the
+.I /proc
+filesystem was mounted.
+(In the initial PID namespace,
+there is no filtering of the records shown in this file.)
+.IP
 The
 .BR lslocks (8)
 command provides a bit more information about each lock.
@@ -3178,6 +3570,13 @@ Amount of memory consumed in
 .BR tmpfs (5)
 filesystems.
 .TP
+.IR KReclaimable " %lu (since Linux 4.20)"
+Kernel allocations that the kernel will attempt to reclaim
+under memory pressure.
+Includes
+.I SReclaimable
+(below), and other direct allocations with a shrinker.
+.TP
 .IR Slab " %lu"
 In-kernel data structures cache.
 (See
@@ -3221,7 +3620,7 @@ only if strict overcommit accounting is enabled (mode 2 in
 The limit is calculated according to the formula described under
 .IR /proc/sys/vm/overcommit_memory .
 For further details, see the kernel source file
-.IR Documentation/vm/overcommit-accounting .
+.IR Documentation/vm/overcommit-accounting.rst .
 .TP
 .IR Committed_AS " %lu"
 The amount of memory presently allocated on the system.
@@ -3249,14 +3648,29 @@ Total size of vmalloc memory area.
 .TP
 .IR VmallocUsed " %lu"
 Amount of vmalloc area which is used.
+Since Linux 4.4,
+.\" commit a5ad88ce8c7fae7ddc72ee49a11a75aa837788e0
+this field is no longer calculated, and is hard coded as 0.
+See
+.IR /proc/vmallocinfo .
 .TP
 .IR VmallocChunk " %lu"
 Largest contiguous block of vmalloc area which is free.
+Since Linux 4.4,
+.\" commit a5ad88ce8c7fae7ddc72ee49a11a75aa837788e0
+this field is no longer calculated and is hard coded as 0.
+See
+.IR /proc/vmallocinfo .
 .TP
 .IR HardwareCorrupted " %lu (since Linux 2.6.32)"
 (\fBCONFIG_MEMORY_FAILURE\fP is required.)
 [To be documented.]
 .TP
+.IR LazyFree " %lu (since Linux 4.12)"
+Shows the amount of memory marked by
+.BR madvise (2)
+.BR MADV_FREE .
+.TP
 .IR AnonHugePages " %lu (since Linux 2.6.38)"
 (\fBCONFIG_TRANSPARENT_HUGEPAGE\fP is required.)
 Non-file backed huge pages mapped into user-space page tables.
@@ -3538,9 +3952,9 @@ The format is:
 .IP
 .in 1n
 .EX
-Num RefCount Protocol Flags    Type St Path
- 0: 00000002 00000000 00000000 0001 03
- 1: 00000001 00000000 00010000 0001 01 /dev/printer
+Num RefCount Protocol Flags    Type St Inode Path
+ 0: 00000002 00000000 00000000 0001 03    42
+ 1: 00000001 00000000 00010000 0001 01  1948 /dev/printer
 .EE
 .in
 .IP
@@ -3572,8 +3986,11 @@ sockets, it is 0005.
 .IR St :
 the internal state of the socket.
 .TP
+.IR Inode :
+the inode number of the socket.
+.TP
 .IR Path :
-the bound path (if any) of the socket.
+the bound pathname (if any) of the socket.
 Sockets in the abstract namespace are included in the list,
 and are shown with a
 .I Path
@@ -3806,10 +4223,12 @@ The value in this field may
 in certain conditions.
 .RE
 .TP
-.IR irq " (since Linux 2.6.0-test4)"
+.IR irq " (since Linux 2.6.0)"
+.\" Precisely: Linux 2.6.0-test4
 (6) Time servicing interrupts.
 .TP
-.IR softirq " (since Linux 2.6.0-test4)"
+.IR softirq " (since Linux 2.6.0"
+.\" Precisely: Linux 2.6.0-test4
 (7) Time servicing softirqs.
 .TP
 .IR steal " (since Linux 2.6.11)"
@@ -3887,13 +4306,13 @@ the \fI/proc\fP filesystem, and the (deprecated)
 .BR sysctl (2)
 system call.
 .IP
-String values may be terminated by either \(aq\\0\(aq or \(aq\\n\(aq.
+String values may be terminated by either \(aq\e0\(aq or \(aq\en\(aq.
 .IP
 Integer and long values may be written either in decimal or in
 hexadecimal notation (e.g. 0x3FFF).
 When writing multiple integer or long values, these may be separated
 by any of the following whitespace characters:
-\(aq\ \(aq, \(aq\\t\(aq, or \(aq\\n\(aq.
+\(aq\ \(aq, \(aq\et\(aq, or \(aq\en\(aq.
 Using other separators leads to the error
 .BR EINVAL .
 .TP
@@ -4445,7 +4864,7 @@ man page.
 .TP
 .I /proc/sys/kernel/hotplug
 This file
-contains the path for the hotplug policy agent.
+contains the pathname for the hotplug policy agent.
 The default value in this file is
 .IR /sbin/hotplug .
 .TP
@@ -4498,7 +4917,7 @@ If 0, the cache is disabled.
 Enabled if nonzero.
 .TP
 .I /proc/sys/kernel/modprobe
-This file contains the path for the kernel module loader.
+This file contains the pathname for the kernel module loader.
 The default value is
 .IR /sbin/modprobe .
 The file is present only if the kernel is built with the
@@ -4546,6 +4965,10 @@ message queue.
 This is a read-only file that displays the upper limit on the
 number of a process's group memberships.
 .TP
+.IR /proc/sys/kernel/ns_last_pid " (since Linux 3.3)"
+See
+.BR pid_namespaces (7).
+.TP
 .IR /proc/sys/kernel/ostype " and " /proc/sys/kernel/osrelease
 These files
 give substrings of
@@ -4716,6 +5139,14 @@ See
 See
 .BR sched (7).
 .TP
+.IR /proc/sys/kernel/seccomp " (since Linux 4.14)"
+.\" commit 8e5f1ad116df6b0de65eac458d5e7c318d1c05af
+This directory provides additional seccomp information and
+configuration.
+See
+.BR seccomp (2)
+for further details.
+.TP
 .IR /proc/sys/kernel/sem " (since Linux 2.4)"
 This file contains 4 numbers defining limits for System V IPC semaphores.
 These fields are, in order:
@@ -5265,7 +5696,7 @@ is instead calculated as:
     CommitLimit = overcommit_kbytes + total_swap
 .IP
 See also the description of
-.IR /proc/sys/vm/admiin_reserve_kbytes
+.IR /proc/sys/vm/admin_reserve_kbytes
 and
 .IR /proc/sys/vm/user_reserve_kbytes .
 .TP
@@ -5364,7 +5795,7 @@ providing similar information to that available via
 .BR ipcs (1).
 These files have headers and are formatted (one IPC object per line)
 for easy understanding.
-.BR svipc (7)
+.BR sysvipc (7)
 provides further background on the information shown by these files.
 .TP
 .IR /proc/thread-self " (since Linux 3.17)"
@@ -5400,9 +5831,9 @@ thereby optimizing power consumption.
 If enabled in the kernel
 .RB ( CONFIG_TIMER_STATS ),
 but not used,
-it has almost zero runtime overhead and a relatively small
+it has almost zero run-time overhead and a relatively small
 data-structure overhead.
-Even if collection is enabled at runtime, overhead is low:
+Even if collection is enabled at run time, overhead is low:
 all the locking is per-CPU and lookup is hashed.
 .IP
 The
@@ -5495,8 +5926,9 @@ Subdirectory containing the pseudo-files and subdirectories for
 tty drivers and line disciplines.
 .TP
 .I /proc/uptime
-This file contains two numbers: the uptime of the system (seconds),
-and the amount of time spent in idle process (seconds).
+This file contains two numbers (values in seconds): the uptime of the
+system (including time spent in suspend) and the amount of time spent
+in the idle process.
 .TP
 .I /proc/version
 This string identifies the kernel version that is currently running.
@@ -5522,7 +5954,7 @@ Linux version 1.0.9 (quinlan@phaze) #1 Sat May 14 01:51:54 EDT 1994
 This file displays various virtual memory statistics.
 Each line of this file contains a single name-value pair,
 delimited by white space.
-Some files are present only if the kernel was configured with
+Some lines are present only if the kernel was configured with
 suitable options.
 (In some cases, the options required for particular files have changed
 across kernel versions, so they are not listed here.
@@ -6009,7 +6441,7 @@ Number of free CMA (Contiguous Memory Allocator) pages.
 .IR compact_stall " (since Linux 2.6.35)"
 .\" commit 56de7263fcf3eb10c8dcdf8d59a9cec831795f3f
 See the kernel source file
-.IR Documentation/vm/transhuge.txt .
+.IR Documentation/admin-guide/mm/transhuge.rst .
 .\" Present only if the kernel was configured with
 .\" .BR CONFIG_VM_EVENT_COUNTERS
 .\" and
@@ -6018,7 +6450,7 @@ See the kernel source file
 .IR compact_fail " (since Linux 2.6.35)"
 .\" commit 56de7263fcf3eb10c8dcdf8d59a9cec831795f3f
 See the kernel source file
-.IR Documentation/vm/transhuge.txt .
+.IR Documentation/admin-guide/mm/transhuge.rst .
 .\" Present only if the kernel was configured with
 .\" .BR CONFIG_VM_EVENT_COUNTERS
 .\" and
@@ -6027,7 +6459,7 @@ See the kernel source file
 .IR compact_success " (since Linux 2.6.35)"
 .\" commit 56de7263fcf3eb10c8dcdf8d59a9cec831795f3f
 See the kernel source file
-.IR Documentation/vm/transhuge.txt .
+.IR Documentation/admin-guide/mm/transhuge.rst .
 .\" Present only if the kernel was configured with
 .\" .BR CONFIG_VM_EVENT_COUNTERS
 .\" and
@@ -6086,7 +6518,7 @@ See the kernel source file
 .IR thp_fault_alloc " (since Linux 2.6.39)"
 .\" commit 81ab4201fb7d91d6b0cd9ad5b4b16776e4bed145
 See the kernel source file
-.IR Documentation/vm/transhuge.txt .
+.IR Documentation/admin-guide/mm/transhuge.rst .
 .\" Present only if the kernel was configured with
 .\" .BR CONFIG_VM_EVENT_COUNTERS
 .\" and
@@ -6095,7 +6527,7 @@ See the kernel source file
 .IR thp_fault_fallback " (since Linux 2.6.39)"
 .\" commit 81ab4201fb7d91d6b0cd9ad5b4b16776e4bed145
 See the kernel source file
-.IR Documentation/vm/transhuge.txt .
+.IR Documentation/admin-guide/mm/transhuge.rst .
 .\" Present only if the kernel was configured with
 .\" .BR CONFIG_VM_EVENT_COUNTERS
 .\" and
@@ -6104,7 +6536,7 @@ See the kernel source file
 .IR thp_collapse_alloc " (since Linux 2.6.39)"
 .\" commit 81ab4201fb7d91d6b0cd9ad5b4b16776e4bed145
 See the kernel source file
-.IR Documentation/vm/transhuge.txt .
+.IR Documentation/admin-guide/mm/transhuge.rst .
 .\" Present only if the kernel was configured with
 .\" .BR CONFIG_VM_EVENT_COUNTERS
 .\" and
@@ -6113,7 +6545,7 @@ See the kernel source file
 .IR thp_collapse_alloc_failed " (since Linux 2.6.39)"
 .\" commit 81ab4201fb7d91d6b0cd9ad5b4b16776e4bed145
 See the kernel source file
-.IR Documentation/vm/transhuge.txt .
+.IR Documentation/admin-guide/mm/transhuge.rst .
 .\" Present only if the kernel was configured with
 .\" .BR CONFIG_VM_EVENT_COUNTERS
 .\" and
@@ -6122,7 +6554,7 @@ See the kernel source file
 .IR thp_split " (since Linux 2.6.39)"
 .\" commit 81ab4201fb7d91d6b0cd9ad5b4b16776e4bed145
 See the kernel source file
-.IR Documentation/vm/transhuge.txt .
+.IR Documentation/admin-guide/mm/transhuge.rst .
 .\" Present only if the kernel was configured with
 .\" .BR CONFIG_VM_EVENT_COUNTERS
 .\" and
@@ -6131,7 +6563,7 @@ See the kernel source file
 .IR thp_zero_page_alloc " (since Linux 3.8)"
 .\" commit d8a8e1f0da3d29d7268b3300c96a059d63901b76
 See the kernel source file
-.IR Documentation/vm/transhuge.txt .
+.IR Documentation/admin-guide/mm/transhuge.rst .
 .\" Present only if the kernel was configured with
 .\" .BR CONFIG_VM_EVENT_COUNTERS
 .\" and
@@ -6140,7 +6572,7 @@ See the kernel source file
 .IR thp_zero_page_alloc_failed " (since Linux 3.8)"
 .\" commit d8a8e1f0da3d29d7268b3300c96a059d63901b76
 See the kernel source file
-.IR Documentation/vm/transhuge.txt .
+.IR Documentation/admin-guide/mm/transhuge.rst .
 .\" Present only if the kernel was configured with
 .\" .BR CONFIG_VM_EVENT_COUNTERS
 .\" and
@@ -6213,12 +6645,17 @@ This file display information about memory zones.
 This is useful for analyzing virtual memory behavior.
 .\" FIXME more should be said about /proc/zoneinfo
 .SH NOTES
-Many strings (i.e., the environment and command line) are in
-the internal format, with subfields terminated by null bytes (\(aq\\0\(aq),
-so you
-may find that things are more readable if you use \fIod \-c\fP or \fItr
-"\\000" "\\n"\fP to read them.
-Alternatively, \fIecho \`cat <file>\`\fP works well.
+Many files contain strings (e.g., the environment and command line)
+that are in the internal format,
+with subfields terminated by null bytes (\(aq\e0\(aq).
+When inspecting such files, you may find that the results are more readable
+if you use a command of the following form to display them:
+.PP
+.in +4n
+.EX
+.RB "$" " cat \fIfile\fP | tr \(aq\e000\(aq \(aq\en\(aq"
+.EE
+.in
 .PP
 This manual page is incomplete, possibly inaccurate, and is the kind
 of thing that needs to be updated very often.
@@ -6230,8 +6667,10 @@ of thing that needs to be updated very often.
 .BR dmesg (1),
 .BR find (1),
 .BR free (1),
+.BR htop (1),
 .BR init (1),
 .BR ps (1),
+.BR pstree (1),
 .BR tr (1),
 .BR uptime (1),
 .BR chroot (2),
@@ -6255,7 +6694,7 @@ of thing that needs to be updated very often.
 .BR sysctl (8)
 .PP
 The Linux kernel source files:
-.IR Documentation/filesystems/proc.txt
+.IR Documentation/filesystems/proc.txt ,
 .IR Documentation/sysctl/fs.txt ,
 .IR Documentation/sysctl/kernel.txt ,
 .IR Documentation/sysctl/net.txt ,