.\" to see what information could be imported from that file
.\" into this file.
.\"
-.TH PROC 5 2013-09-04 "Linux" "Linux Programmer's Manual"
+.TH PROC 5 2014-05-28 "Linux" "Linux Programmer's Manual"
.SH NAME
proc \- process information pseudo-filesystem
.SH DESCRIPTION
This file is present only if the
.B CONFIG_CGROUPS
kernel configuration option is enabled.
+.TP
+.IR /proc/[pid]/clear_refs " (since Linux 2.6.22)"
+.\" commit b813e931b4c8235bb42e301096ea97dbdee3e8fe (2.6.22)
+.\" commit 398499d5f3613c47f2143b8c54a04efb5d7a6da9 (2.6.32)
+.\" commit 040fa02077de01c7e08fa75be6125e4ca5636011 (3.11)
.\"
-.\" FIXME Describe /proc/[pid]/clear_refs
-.\" Added in 2.6.22
.\" "Clears page referenced bits shown in smaps output"
-.\" write-only
-.\" CONFIG_PROC_PAGE_MONITOR
+.\" write-only, writable only by the owner of the process
+
+This is a write-only file, writable only by owner of the process.
+
+The following values may be written to the file:
+.RS
+.TP
+1 (since Linux 2.6.22)
+.\" Internally: CLEAR_REFS_ALL
+Reset the PG_Referenced and ACCESSED/YOUNG
+bits for all the pages associated with the process.
+(Before kernel 2.6.32, writing any nonzero value to this file
+had this effect.)
+.TP
+2 (since Linux 2.6.32)
+.\" Internally: CLEAR_REFS_ANON
+Reset the PG_Referenced and ACCESSED/YOUNG
+bits for all anonymous pages associated with the process.
+.TP
+3 (since Linux 2.6.32)
+.\" Internally: CLEAR_REFS_MAPPED
+Reset the PG_Referenced and ACCESSED/YOUNG
+bits for all file-mapped pages associated with the process.
+.RE
+.IP
+Clearing the PG_Referenced and ACCESSED/YOUNG bits provides a method
+to measure approximately how much memory a process is using.
+One first inspects the values in the "Referenced" fields
+for the VMAs shown in
+.IR /proc/[pid]/smaps
+to get an idea of the memory footprint of the
+process.
+One then clears the PG_Referenced and ACCESSED/YOUNG bits
+and, after some measured time interval,
+once again inspects the values in the "Referenced" fields
+to get an idea of the change in memory footprint of the
+process during the measured interval.
+If one is interested only in inspecting the selected mapping types,
+then the value 2 or 3 can be used instead of 1.
+
+A further value can be written to affect a different bit:
+.RS
+.TP
+4 (since Linux 3.11)
+Clear the soft-dirty bit for all the pages associated with the process.
+.\" Internally: CLEAR_REFS_SOFT_DIRTY
+This is used (in conjunction with
+.IR /proc/[pid]/pagemap )
+by the check-point restore system to discover which pages of a process
+have been dirtied since the file
+.IR /proc/[pid]/clear_refs
+was written to.
+.RE
+.IP
+Writing any value to
+.IR /proc/[pid]/clear_refs
+other than those listed above has no effect.
+
+The
+.IR /proc/[pid]/clear_refs
+file is present only if the
+.B CONFIG_PROC_PAGE_MONITOR
+kernel configuration option is enabled.
.TP
.I /proc/[pid]/cmdline
This holds the complete command line for the process,
This is a subdirectory containing one entry for each file which the
process has open, named by its file descriptor, and which is a
symbolic link to the actual file.
-Thus, 0 is standard input, 1 standard output, 2 standard error, etc.
+Thus, 0 is standard input, 1 standard output, 2 standard error, and so on.
For file descriptors for pipes and sockets,
the entries will be symbolic links whose content is the
.BR open (2)).
The files in this directory are readable only by the owner of the process.
+.\" FIXME
+.\" Certain file types include additional info; see
+.\" Documentation/filesystems/proc.txt
+.\"
+.\" Especially interesting is this:
+.\"
+.\" commit ab49bdecc3ebb46ab661f5f05d5c5ea9606406c6
+.\" Author: Cyrill Gorcunov <gorcunov@openvz.org>
+.\" Date: Mon Dec 17 16:05:06 2012 -0800
+.\"
+.\" Basically, the /proc/PID/fdinfo/ entry for an inotify FD
+.\" includes the file handles for all watched FDs
+.\"
.TP
.IR /proc/[pid]/io " (since kernel 2.6.20)"
.\" commit 7c3ab7381e79dfc7db14a67c6f4f3285664e1ec2
.I /proc/[pid]/io
while process B is updating one of these 64-bit counters,
process A could see an intermediate result.
-.RE
.TP
.IR /proc/[pid]/limits " (since kernel 2.6.24)"
This file displays the soft limit, hard limit, and units of measurement
.in
Although these entries are present for memory regions that were
-mapped with the
+mapped with the
.BR MAP_FILE
flag, the way anonymous shared memory (regions created with the
.B MAP_ANON | MAP_SHARED
.IR [heap]
The process's heap.
.in
-.fi
.RE
.IP
If the
mount source: filesystem-specific information or "none".
.TP
(11)
-super options: per-super block options.
+super options: per-superblock options.
.RE
.IP
Parsers should ignore all unrecognized optional fields.
.BR chroot (2)
system call.
This file is a symbolic link that points to the process's
-root directory, and behaves as exe, fd/*, etc. do.
+root directory, and behaves in the same way as
+.IR exe ,
+and
+.IR fd/* .
.\" The following was still true as at kernel 2.6.13
In a multithreaded process, the contents of this symbolic link
.\" CONFIG_SCHEDSTATS
.TP
.IR /proc/[pid]/smaps " (since Linux 2.6.14)"
-.\" CONFIG_PROC_PAGE_MONITOR
This file shows memory consumption for each of the process's mappings.
-For each of mappings there is a series of lines such as the following:
+For each mapping there is a series of lines such as the following:
.in +4n
.nf
-08048000-080bc000 r-xp 00000000 03:02 13130 /bin/bash
-Size: 464 kB
-Rss: 424 kB
-Shared_Clean: 424 kB
-Shared_Dirty: 0 kB
-Private_Clean: 0 kB
-Private_Dirty: 0 kB
+00400000-0048a000 r-xp 00000000 fd:03 960637 /bin/bash
+Size: 552 kB
+Rss: 460 kB
+Pss: 100 kB
+Shared_Clean: 452 kB
+Shared_Dirty: 0 kB
+Private_Clean: 8 kB
+Private_Dirty: 0 kB
+Referenced: 460 kB
+Anonymous: 0 kB
+AnonHugePages: 0 kB
+Swap: 0 kB
+KernelPageSize: 4 kB
+MMUPageSize: 4 kB
+Locked: 0 kB
.fi
.in
for the mapping in
.IR /proc/[pid]/maps .
The remaining lines show the size of the mapping,
-the amount of the mapping that is currently resident in RAM,
+the amount of the mapping that is currently resident in RAM ("Rss"),
+the process' proportional share of this mapping ("Pss"),
the number of clean and dirty shared pages in the mapping,
and the number of clean and dirty private pages in the mapping.
+"Referenced" indicates the amount of memory currently marked as
+referenced or accessed.
+"Anonymous" shows the amount of memory
+that does not belong to any file.
+"Swap" shows how much
+would-be-anonymous memory is also used, but out on swap.
+
+The "KernelPageSize" entry is the page size used by the kernel to back a VMA.
+This matches the size used by the MMU in the majority of cases.
+However, one counter-example occurs on PPC64 kernels
+whereby a kernel using 64K as a base page size may still use 4K
+pages for the MMU on older processors.
+To distinguish, this
+patch reports "MMUPageSize" as the page size used by the MMU.
+
+The "Locked" indicates whether the mapping is locked in memory
+or not.
+
+"VmFlags" field represents the kernel flags associated with
+the particular virtual memory area in two letter encoded manner.
+The codes are the following:
+
+ rd - readable
+ wr - writable
+ ex - executable
+ sh - shared
+ mr - may read
+ mw - may write
+ me - may execute
+ ms - may share
+ gd - stack segment grows down
+ pf - pure PFN range
+ dw - disabled write to the mapped file
+ lo - pages are locked in memory
+ io - memory mapped I/O area
+ sr - sequential read advise provided
+ rr - random read advise provided
+ dc - do not copy area on fork
+ de - do not expand area on remapping
+ ac - area is accountable
+ nr - swap space is not reserved for the area
+ ht - area uses huge tlb pages
+ nl - non-linear mapping
+ ar - architecture specific flag
+ dd - do not include area into core dump
+ sd - soft-dirty flag
+ mm - mixed map area
+ hg - huge page advise flag
+ nh - no-huge page advise flag
+ mg - mergeable advise flag
-This file is present only if the
-.B CONFIG_MMU
-kernel configuration
-option is enabled.
+The
+.IR /proc/[pid]/smaps
+file is present only if the
+.B CONFIG_PROC_PAGE_MONITOR
+kernel configuration option is enabled.
+.TP
+.IR /proc/[pid]/stack " (since Linux 2.6.29)"
+.\" 2ec220e27f5040aec1e88901c1b6ea3d135787ad
+This file provides a symbolic trace of the function calls in this
+process's kernel stack.
+This file is provided only if the kernel was built with the
+.B CONFIG_STACKTRACE
+configuration option.
.TP
.I /proc/[pid]/stat
Status information about the process.
.TP
\fIwchan\fP %lu
(35) This is the "channel" in which the process is waiting.
-It is the
-address of a system call, and can be looked up in a namelist if you
-need a textual name.
-(If you have an up-to-date
-.IR /etc/psdatabase ,
-then
-try \fIps \-l\fP to see the WCHAN field in action.)
+It is the address of a location in the kernel where the process is sleeping.
+The corresponding symbolic name can be found in
+.IR /proc/[pid]/wchan .
.TP
\fInswap\fP %lu
(36)
(typically by calling
.BR pthread_exit (3)).
.TP
+.IR /proc/[pid]/wchan " (since Linux 2.6.0)"
+The symbolic name corresponding to the location
+in the kernel where the process is sleeping.
+.TP
.I /proc/apm
Advanced power management version and battery information when
.B CONFIG_APM
.B CONFIG_PCMCIA
is set at kernel compilation time.
.TP
+.IR /proc/[pid]/timers " (since Linux 3.10)"
+.\" commit 5ed67f05f66c41e39880a6d61358438a25f9fee5
+.\" commit 48f6a7a511ef8823fdff39afee0320092d43a8a0
+A list of the POSIX timers for this process.
+Each timer is listed with a line that started with the string "ID:".
+For example:
+
+.in +4n
+.nf
+ID: 1
+signal: 60/00007fff86e452a8
+notify: signal/pid.2634
+ClockID: 0
+ID: 0
+signal: 60/00007fff86e452a8
+notify: signal/pid.2634
+ClockID: 1
+.fi
+.in
+
+The lines shown for each timer have the following meanings:
+.RS
+.TP
+.I ID
+The ID for this timer.
+This is not the same as the timer ID returned by
+.BR timer_create (2);
+rather, it is the same kernel-internal ID that is available via the
+.I si_timerid
+field of the
+.IR siginfo_t
+structure (see
+.BR sigaction (2)).
+.TP
+.I signal
+This is the signal number that this timer uses to deliver notifications
+followed by a slash, and then the
+.I sigev_value.sival_ptr
+value supplied to the signal handler.
+Valid only for timers that notify via a signal.
+.TP
+.I notify
+The part before the slash specifies the mechanism
+that this timer uses to deliver notifications,
+and is one of "thread", "signal", or "none".
+Immediately following the slash is either the string "tid" for timers
+with
+.B SIGEV_THREAD_ID
+notification, or "pid" for timers that notify by other mechanisms.
+Following the "." is the PID of the process that will be delivered
+a signal if the timer delivers notifications via a signal.
+.TP
+.I ClockID
+This field identifies the clock that the timer uses for measuring time.
+For most clocks, this is a number that matches one of the user-space
+.BR CLOCK_*
+constants exposed via
+.IR <time.h> .
+.B CLOCK_PROCESS_CPUTIME_ID
+timers display with a value of -6
+in this field.
+.B CLOCK_THREAD_CPUTIME_ID
+timers display with a value of -2
+in this field.
+.RE
+.TP
.I /proc/bus/pccard/drivers
.TP
.I /proc/bus/pci
.IR "make config" ,
or similar).
The file contents are compressed; view or search them using
-.BR zcat (1),
-.BR zgrep (1),
-etc.
+.BR zcat (1)
+and
+.BR zgrep (1).
As long as no changes have been made to the following file,
the contents of
.I /proc/config.gz
the format specifier required to read the field value.
Except as noted below,
all of the fields have been present since at least Linux 2.6.0.
-Some fileds are displayed only if the kernel was configured
+Some fields are displayed only if the kernel was configured
with various options; those dependencies are noted in the list.
.RS
.TP
.IR MemTotal " %lu"
-Total usable RAM (i.e. physical RAM minus a few reserved
+Total usable RAM (i.e., physical RAM minus a few reserved
bits and the kernel binary code).
.TP
.IR MemFree " %lu"
Non-file backed pages mapped into user-space page tables.
.TP
.IR Mapped " %lu"
-Files which have been mmaped, such as libraries.
+Files which have been mapped into memory (with
+.BR mmap (2)),
+such as libraries.
.TP
.IR Shmem " %lu (since Linux 2.6.32)"
[To be documented.]
.TP
.IR CommitLimit " %lu (since Linux 2.6.10)"
Based on the overcommit ratio ('vm.overcommit_ratio'),
-this is the total amount of memory currently available to
+this is the total amount of memory currently available to
be allocated on the system.
This limit is adhered to
only if strict overcommit accounting is enabled (mode 2 in
.I CommitLimit
is calculated using the following formula:
- CommitLimit = (overcommit_ratio * Physical RAM) + Swap
+ CommitLimit =
+ ([total RAM pages] - [total huge TLB pages]) *
+ overcommit_ratio / 100 + [total swap pages]
For example, on a system with 1GB of physical RAM and 7GB
of swap with a
initialization.
Reading these files will usually show driver and host configuration,
-statistics, etc.
+statistics, and so on.
Writing to these files allows different things on different hosts.
For example, with the \fIlatency\fP and \fInolatency\fP commands,
\fIintr 1462898\fP
This line shows counts of interrupts serviced since boot time,
for each of the possible system interrupts.
-The first column is the total of all interrupts serviced;
-each subsequent column is the total for a particular interrupt.
+The first column is the total of all interrupts serviced
+including unnumbered architecture specific interrupts;
+each subsequent column is the total for that particular numbered interrupt.
+Unnumbered interrupts are not shown, only summed into the total.
.TP
\fIdisk_io: (2,0):(31,30,5764,1,2) (3,0):\fP...
(major,disk_idx):(noinfo, read_io_ops, blks_read, write_io_ops, blks_written)
.IP *
the link is not in a sticky world-writable directory; or
.IP *
-the symbolic link and and its parent directory have the same owner (UID)
+the symbolic link and its parent directory have the same owner (UID)
.RE
.IP
A system call that fails to follow a symbolic link
.IR lowwater ,
and
.IR frequency .
-If BSD-style process accounting is enabled these values control
+If BSD-style process accounting is enabled, these values control
its behavior.
If free space on filesystem where the log lives goes below
.I lowwater
-percent accounting suspends.
+percent, accounting suspends.
If free space gets above
.I highwater
-percent accounting resumes.
+percent, accounting resumes.
.I frequency
determines
how often the kernel checks the amount of free space (value is in
.B CONFIG_MODULES
option enabled.
.TP
-.I /proc/sys/kernel/msgmax
+.IR /proc/sys/kernel/msgmax " (since Linux 2.2)"
This file defines
a system-wide limit specifying the maximum number of bytes in
a single message written on a System V message queue.
This file defines the system-wide limit on the number of
message queue identifiers.
.TP
-.I /proc/sys/kernel/msgmnb
+.IR /proc/sys/kernel/msgmnb " (since Linux 2.2)"
This file defines a system-wide parameter used to initialize the
.I msg_qbytes
setting for subsequently created message queues.
setting specifies the maximum number of bytes that may be written to the
message queue.
.TP
+.IR /proc/sys/kernel/ngroups_max " (since Linux 2.6.4)"
+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/ostype " and " /proc/sys/kernel/osrelease
These files
give substrings of
.I /proc/sys/kernel/panic
This file gives read/write access to the kernel variable
.IR panic_timeout .
-If this is zero, the kernel will loop on a panic; if nonzero
+If this is zero, the kernel will loop on a panic; if nonzero,
it indicates that the kernel should autoreboot after this number
of seconds.
When you use the
and then panics.
If the
.I /proc/sys/kernel/panic
-file is also nonzero then the machine will be rebooted.
+file is also nonzero, then the machine will be rebooted.
.TP
.IR /proc/sys/kernel/pid_max " (since Linux 2.5.34)"
This file specifies the value at which PIDs wrap around
(i.e., the value in this file is one greater than the maximum PID).
+PIDs greater than this value not allocated;
+thus, the value in this file also acts as a system-wide limit
+on the total number of processes and threads.
The default value for this file, 32768,
results in the same range of PIDs as on earlier kernels.
On 32-bit platforms, 32768 is the maximum value for
.BR random (4)
for further information.
.TP
+.IR /proc/sys/kernel/random/uuid " (since Linux 2.4)"
+Each read from this read-only file returns a randomly generated 128-bit UUID,
+as a string in the standard UUID format.
+.TP
.I /proc/sys/kernel/real-root-dev
This file is documented in the Linux kernel source file
.IR Documentation/initrd.txt .
See
.BR sched_rr_get_interval (2).
.TP
+.IR /proc/sys/kernel/sched_rt_period_us " (Since Linux 2.6.25)"
+See
+.BR sched (7).
+.TP
+.IR /proc/sys/kernel/sched_rt_runtime_us " (Since Linux 2.6.25)"
+See
+.BR sched (7).
+.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:
The effect is as though a
.BR shmctl (2)
.B IPC_RMID
-is performed on all existing segments as well as all segments
+is performed on all existing segments as well as all segments
created in the future (until this file is reset to 0).
Note that existing segments that are attached to no process will be
immediately destroyed when this file is set to 1.
of the semantics of the applications using
System V shared memory on your system.
.TP
-.I /proc/sys/kernel/shmall
+.IR /proc/sys/kernel/shmall " (since Linux 2.2)"
This file
contains the system-wide limit on the total number of pages of
System V shared memory.
.TP
-.I /proc/sys/kernel/shmmax
+.IR /proc/sys/kernel/shmmax " (since Linux 2.2)"
This file
can be used to query and set the run-time limit
on the maximum (System V IPC) shared memory segment size that can be
8 - enable debugging dumps of processes etc.
16 - enable sync command
32 - enable remount read-only
- 64 - enable signalling of processes (term, kill, oom-kill)
+ 64 - enable signaling of processes (term, kill, oom-kill)
128 - allow reboot/poweroff
256 - allow nicing of all real-time tasks
then the kernel normally panics when out-of-memory happens.
However, if a process limits allocations to certain nodes
using memory policies
-.RB ( mbind (2)
+.RB ( mbind (2)
.BR MPOL_BIND )
or cpusets
.RB ( cpuset (7))
.TP
.I /proc/sysvipc
Subdirectory containing the pseudo-files
-.IR msg ", " sem " and " shm "."
+.IR msg ", " sem " and " shm "."
These files list the System V Interprocess Communication (IPC) objects
(respectively: message queues, semaphores, and shared memory)
that currently exist on the system,
.BR svipc (7)
provides further background on the information shown by these files.
.TP
+.IR /proc/timer_list " (since Linux 2.6.21)"
+.\" commit 289f480af87e45f7a6de6ba9b4c061c2e259fe98
+This read-only file exposes a list of all currently pending
+(high-resolution) timers,
+all clock-event sources, and their parameters in a human-readable form.
+.TP
+.IR /proc/timer_stats " (since Linux 2.6.21)"
+.\" commit 82f67cd9fca8c8762c15ba7ed0d5747588c1e221
+.\" Date: Fri Feb 16 01:28:13 2007 -0800
+.\" Text largely derived from Documentation/timers/timer_stats.txt
+This is a debugging facility to make timer (ab)use in a Linux
+system visible to kernel and user-space developers.
+It can be used by kernel and user-space developers to verify that
+their code does not make undue use of timers.
+The goal is to avoid unnecessary wakeups,
+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
+data-structure overhead.
+Even if collection is enabled at runtime, overhead is low:
+all the locking is per-CPU and lookup is hashed.
+
+The
+.I /proc/timer_stats
+file is used both to control sampling facility and to read out the
+sampled information.
+
+timer_stats collects information about the timer events which are fired in a
+Linux system over a sample period:
+
+- the pid of the task(process) which initialized the timer
+- the name of the process which initialized the timer
+- the function where the timer was initialized
+- the callback function which is associated to the timer
+- the number of events (callbacks)
+
+The timer_stats functionality is inactive on bootup.
+A sampling period can be started using the following command:
+
+ # echo 1 > /proc/timer_stats
+
+The following command stops a sampling period:
+
+ # echo 0 > /proc/timer_stats
+
+The statistics can be retrieved by:
+
+ $ cat /proc/timer_stats
+
+While sampling is enabled, each readout from /proc/timer_stats will see
+newly updated statistics.
+Once sampling is disabled, the sampled information
+is kept until a new sample period is started.
+This allows multiple readouts.
+
+Sample output from
+.IR /proc/timer_stats :
+
+.nf
+.RS -4
+.RB $ " cat /proc/timer_stats"
+Timer Stats Version: v0.3
+Sample period: 1.764 s
+Collection: active
+ 255, 0 swapper/3 hrtimer_start_range_ns (tick_sched_timer)
+ 71, 0 swapper/1 hrtimer_start_range_ns (tick_sched_timer)
+ 58, 0 swapper/0 hrtimer_start_range_ns (tick_sched_timer)
+ 4, 1694 gnome-shell mod_delayed_work_on (delayed_work_timer_fn)
+ 17, 7 rcu_sched rcu_gp_kthread (process_timeout)
+\&...
+ 1, 4911 kworker/u16:0 mod_delayed_work_on (delayed_work_timer_fn)
+ 1D, 2522 kworker/0:0 queue_delayed_work_on (delayed_work_timer_fn)
+1029 total events, 583.333 events/sec
+
+.fi
+.RE
+.IP
+The output columns are:
+.RS
+.IP * 3
+a count of the number of events,
+optionally (since Linux 2.6.23) followed by the letter \(aqD\(aq
+.\" commit c5c061b8f9726bc2c25e19dec227933a13d1e6b7 deferrable timers
+if this is a deferrable timer;
+.IP *
+the PID of the process that initialized the timer;
+.IP *
+the name of the process that initialized the timer;
+.IP *
+the function where the timer was initialized; and
+.IP *
+(in parentheses)
+the callback function that is associated with the timer.
+.RE
+.TP
.I /proc/tty
Subdirectory containing the pseudo-files and subdirectories for
tty drivers and line disciplines.
The Linux kernel source files:
.IR Documentation/filesystems/proc.txt
+.IR Documentation/sysctl/fs.txt ,
+.IR Documentation/sysctl/kernel.txt ,
+.IR Documentation/sysctl/net.txt ,
and
.IR Documentation/sysctl/vm.txt .
+.SH COLOPHON
+This page is part of release 3.68 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.