OSDN Git Service

LDP: Update original to LDP v3.68
[linuxjm/LDP_man-pages.git] / original / man5 / proc.5
index 71a56d8..2db8636 100644 (file)
@@ -59,7 +59,7 @@
 .\" to see what information could be imported from that file
 .\" into this file.
 .\"
-.TH PROC 5 2014-03-17 "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
@@ -121,12 +121,76 @@ control group in the hierarchy to which the process belongs
 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,
@@ -350,6 +414,19 @@ file access mode and file status flags (see
 .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
@@ -462,7 +539,7 @@ lr\-\-\-\-\-\-\-\-. 1 root root 64 Apr 16 21:31
 .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
@@ -956,19 +1033,26 @@ are not available if the main thread has already terminated
 .\"       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
@@ -976,14 +1060,74 @@ The first of these lines shows the same information as is displayed
 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.
@@ -1785,7 +1929,7 @@ The list below describes the parameter names and
 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
@@ -1894,7 +2038,9 @@ Memory which is actively being written back to the disk.
 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.]
@@ -1933,7 +2079,7 @@ Memory used by FUSE for temporary writeback buffers.
 .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
@@ -2420,8 +2566,10 @@ The number of swap pages that have been brought in and out.
 \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)
@@ -2839,14 +2987,14 @@ contains three numbers:
 .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
@@ -3014,7 +3162,7 @@ The file is present only if the kernel is built with the
 .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.
@@ -3023,7 +3171,7 @@ 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.
@@ -3050,7 +3198,7 @@ and
 .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
@@ -3066,11 +3214,14 @@ delays a few seconds (to give klogd time to record the oops output)
 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
@@ -3166,6 +3317,14 @@ This file shows the number POSIX real-time signals currently queued.
 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:
@@ -3205,7 +3364,7 @@ that exist independently of any attached process.
 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.
@@ -3229,12 +3388,12 @@ Only set this file to 1 if you have a good understanding
 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
@@ -3504,7 +3663,7 @@ If this file is set to the value 1,
 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))
@@ -3541,7 +3700,7 @@ For further details see the Linux kernel source file
 .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,
@@ -3552,6 +3711,104 @@ for easy understanding.
 .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.
@@ -3638,3 +3895,12 @@ The Linux kernel source files:
 .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/.