@@ -123,10 +123,10 @@ show you how you can use /proc/sys to change settings.
123
123
The directory /proc contains (among other things) one subdirectory for each
124
124
process running on the system, which is named after the process ID (PID).
125
125
126
- The link self points to the process reading the file system. Each process
126
+ The link ' self' points to the process reading the file system. Each process
127
127
subdirectory has the entries listed in Table 1-1.
128
128
129
- Note that an open a file descriptor to /proc/<pid> or to any of its
129
+ Note that an open file descriptor to /proc/<pid> or to any of its
130
130
contained files or subdirectories does not prevent <pid> being reused
131
131
for some other process in the event that <pid> exits. Operations on
132
132
open /proc/<pid> file descriptors corresponding to dead processes
@@ -220,7 +220,7 @@ file /proc/PID/status. It fields are described in table 1-2.
220
220
221
221
The statm file contains more detailed information about the process
222
222
memory usage. Its seven fields are explained in Table 1-3. The stat file
223
- contains details information about the process itself. Its fields are
223
+ contains detailed information about the process itself. Its fields are
224
224
explained in Table 1-4.
225
225
226
226
(for SMP CONFIG users)
782
782
For this case the APIC will generate the interrupt with a IRQ vector
783
783
of 0xff. This might also be generated by chipset bugs.
784
784
785
- RES, CAL, TLB]
785
+ RES, CAL, TLB
786
786
rescheduling, call and TLB flush interrupts are
787
787
sent from one CPU to another per the needs of the OS. Typically,
788
788
their statistics are used by kernel developers and interested users to
@@ -794,7 +794,7 @@ suppressed when the system is a uniprocessor. As of this writing, only
794
794
i386 and x86_64 platforms support the new IRQ vector displays.
795
795
796
796
Of some interest is the introduction of the /proc/irq directory to 2.4.
797
- It could be used to set IRQ to CPU affinity, this means that you can "hook" an
797
+ It could be used to set IRQ to CPU affinity. This means that you can "hook" an
798
798
IRQ to only one CPU, or to exclude a CPU of handling IRQs. The contents of the
799
799
irq subdir is one subdir for each IRQ, and two files; default_smp_affinity and
800
800
prof_cpu_mask.
@@ -808,7 +808,7 @@ For example::
808
808
smp_affinity
809
809
810
810
smp_affinity is a bitmask, in which you can specify which CPUs can handle the
811
- IRQ, you can set it by doing::
811
+ IRQ. You can set it by doing::
812
812
813
813
> echo 1 > /proc/irq/10/smp_affinity
814
814
@@ -821,7 +821,7 @@ The contents of each smp_affinity file is the same by default::
821
821
ffffffff
822
822
823
823
There is an alternate interface, smp_affinity_list which allows specifying
824
- a cpu range instead of a bitmask::
824
+ a CPU range instead of a bitmask::
825
825
826
826
> cat /proc/irq/0/smp_affinity_list
827
827
1024-1031
@@ -835,7 +835,7 @@ reports itself as being attached. This hardware locality information does not
835
835
include information about any possible driver locality preference.
836
836
837
837
prof_cpu_mask specifies which CPUs are to be profiled by the system wide
838
- profiler. Default value is ffffffff (all cpus if there are only 32 of them).
838
+ profiler. Default value is ffffffff (all CPUs if there are only 32 of them).
839
839
840
840
The way IRQs are routed is handled by the IO-APIC, and it's Round Robin
841
841
between all the CPUs which are allowed to handle it. As usual the kernel has
@@ -897,7 +897,7 @@ pagetypeinfo::
897
897
898
898
Fragmentation avoidance in the kernel works by grouping pages of different
899
899
migrate types into the same contiguous regions of memory called page blocks.
900
- A page block is typically the size of the default hugepage size e.g. 2MB on
900
+ A page block is typically the size of the default hugepage size, e.g. 2MB on
901
901
X86-64. By keeping pages grouped based on their ability to move, the kernel
902
902
can reclaim pages within a page block to satisfy a high-order allocation.
903
903
@@ -965,7 +965,7 @@ varies by architecture and compile options. The following is from a
965
965
ShmemPmdMapped: 0 kB
966
966
967
967
MemTotal
968
- Total usable ram (i.e. physical ram minus a few reserved
968
+ Total usable RAM (i.e. physical RAM minus a few reserved
969
969
bits and the kernel binary code)
970
970
MemFree
971
971
The sum of LowFree+HighFree
@@ -996,7 +996,7 @@ Inactive
996
996
Memory which has been less recently used. It is more
997
997
eligible to be reclaimed for other purposes
998
998
HighTotal, HighFree
999
- Highmem is all memory above ~860MB of physical memory
999
+ Highmem is all memory above ~860MB of physical memory.
1000
1000
Highmem areas are for use by userspace programs, or
1001
1001
for the pagecache. The kernel must use tricks to access
1002
1002
this memory, making it slower to access than lowmem.
@@ -1078,7 +1078,7 @@ Committed_AS
1078
1078
using 1G. This 1G is memory which has been "committed" to
1079
1079
by the VM and can be used at any time by the allocating
1080
1080
application. With strict overcommit enabled on the system
1081
- (mode 2 in 'vm.overcommit_memory'),allocations which would
1081
+ (mode 2 in 'vm.overcommit_memory'), allocations which would
1082
1082
exceed the CommitLimit (detailed above) will not be permitted.
1083
1083
This is useful if one needs to guarantee that processes will
1084
1084
not fail due to lack of memory once that memory has been
@@ -1099,7 +1099,7 @@ vmallocinfo
1099
1099
Provides information about vmalloced/vmaped areas. One line per area,
1100
1100
containing the virtual address range of the area, size in bytes,
1101
1101
caller information of the creator, and optional information depending
1102
- on the kind of area :
1102
+ on the kind of area:
1103
1103
1104
1104
========== ===================================================
1105
1105
pages=nr number of pages
@@ -1144,21 +1144,21 @@ on the kind of area :
1144
1144
softirqs
1145
1145
~~~~~~~~
1146
1146
1147
- Provides counts of softirq handlers serviced since boot time, for each cpu .
1147
+ Provides counts of softirq handlers serviced since boot time, for each CPU .
1148
1148
1149
1149
::
1150
1150
1151
1151
> cat /proc/softirqs
1152
- CPU0 CPU1 CPU2 CPU3
1152
+ CPU0 CPU1 CPU2 CPU3
1153
1153
HI: 0 0 0 0
1154
- TIMER: 27166 27120 27097 27034
1154
+ TIMER: 27166 27120 27097 27034
1155
1155
NET_TX: 0 0 0 17
1156
1156
NET_RX: 42 0 0 39
1157
- BLOCK: 0 0 107 1121
1158
- TASKLET: 0 0 0 290
1159
- SCHED: 27035 26983 26971 26746
1160
- HRTIMER: 0 0 0 0
1161
- RCU: 1678 1769 2178 2250
1157
+ BLOCK: 0 0 107 1121
1158
+ TASKLET: 0 0 0 290
1159
+ SCHED: 27035 26983 26971 26746
1160
+ HRTIMER: 0 0 0 0
1161
+ RCU: 1678 1769 2178 2250
1162
1162
1163
1163
1164
1164
1.3 IDE devices in /proc/ide
@@ -1169,7 +1169,7 @@ the kernel is aware. There is one subdirectory for each IDE controller, the
1169
1169
file drivers and a link for each IDE device, pointing to the device directory
1170
1170
in the controller specific subtree.
1171
1171
1172
- The file drivers contains general information about the drivers used for the
1172
+ The file ' drivers' contains general information about the drivers used for the
1173
1173
IDE devices::
1174
1174
1175
1175
> cat /proc/ide/drivers
@@ -1409,7 +1409,7 @@ These directories contain the four files shown in Table 1-10.
1409
1409
-------------------------
1410
1410
1411
1411
Information about the available and actually used tty's can be found in the
1412
- directory /proc/tty.You'll find entries for drivers and line disciplines in
1412
+ directory /proc/tty. You'll find entries for drivers and line disciplines in
1413
1413
this directory, as shown in Table 1-11.
1414
1414
1415
1415
@@ -1471,9 +1471,9 @@ second). The meanings of the columns are as follows, from left to right:
1471
1471
- iowait: In a word, iowait stands for waiting for I/O to complete. But there
1472
1472
are several problems:
1473
1473
1474
- 1. Cpu will not wait for I/O to complete, iowait is the time that a task is
1475
- waiting for I/O to complete. When cpu goes into idle state for
1476
- outstanding task io , another task will be scheduled on this CPU.
1474
+ 1. CPU will not wait for I/O to complete, iowait is the time that a task is
1475
+ waiting for I/O to complete. When CPU goes into idle state for
1476
+ outstanding task I/O , another task will be scheduled on this CPU.
1477
1477
2. In a multi-core CPU, the task waiting for I/O to complete is not running
1478
1478
on any CPU, so the iowait of each CPU is difficult to calculate.
1479
1479
3. The value of iowait field in /proc/stat will decrease in certain
@@ -1529,8 +1529,8 @@ in Table 1-12, below.
1529
1529
mb_groups details of multiblock allocator buddy cache of free blocks
1530
1530
============== ==========================================================
1531
1531
1532
- 2.0 /proc/consoles
1533
- ------------------
1532
+ 1.10 /proc/consoles
1533
+ -------------------
1534
1534
Shows registered system console lines.
1535
1535
1536
1536
To see which character device lines are currently used for the system console
@@ -1590,10 +1590,9 @@ production system. Set up a development machine and test to make sure that
1590
1590
everything works the way you want it to. You may have no alternative but to
1591
1591
reboot the machine once an error has been made.
1592
1592
1593
- To change a value, simply echo the new value into the file. An example is
1594
- given below in the section on the file system data. You need to be root to do
1595
- this. You can create your own boot script to perform this every time your
1596
- system boots.
1593
+ To change a value, simply echo the new value into the file.
1594
+ You need to be root to do this. You can create your own boot script
1595
+ to perform this every time your system boots.
1597
1596
1598
1597
The files in /proc/sys can be used to fine tune and monitor miscellaneous and
1599
1598
general things in the operation of the Linux kernel. Since some of the files
@@ -1624,8 +1623,8 @@ Chapter 3: Per-process Parameters
1624
1623
3.1 /proc/<pid>/oom_adj & /proc/<pid>/oom_score_adj- Adjust the oom-killer score
1625
1624
--------------------------------------------------------------------------------
1626
1625
1627
- These file can be used to adjust the badness heuristic used to select which
1628
- process gets killed in out of memory conditions.
1626
+ These files can be used to adjust the badness heuristic used to select which
1627
+ process gets killed in out of memory (oom) conditions.
1629
1628
1630
1629
The badness heuristic assigns a value to each candidate task ranging from 0
1631
1630
(never kill) to 1000 (always kill) to determine which process is targeted. The
@@ -1681,15 +1680,15 @@ minimal amount of work.
1681
1680
3.2 /proc/<pid>/oom_score - Display current oom-killer score
1682
1681
-------------------------------------------------------------
1683
1682
1684
- This file can be used to check the current score used by the oom-killer is for
1683
+ This file can be used to check the current score used by the oom-killer for
1685
1684
any given <pid>. Use it together with /proc/<pid>/oom_score_adj to tune which
1686
1685
process should be killed in an out-of-memory situation.
1687
1686
1688
1687
1689
1688
3.3 /proc/<pid>/io - Display the IO accounting fields
1690
1689
-------------------------------------------------------
1691
1690
1692
- This file contains IO statistics for each running process
1691
+ This file contains IO statistics for each running process.
1693
1692
1694
1693
Example
1695
1694
~~~~~~~
@@ -1720,7 +1719,7 @@ The number of bytes which this task has caused to be read from storage. This
1720
1719
is simply the sum of bytes which this process passed to read() and pread().
1721
1720
It includes things like tty IO and it is unaffected by whether or not actual
1722
1721
physical disk IO was required (the read might have been satisfied from
1723
- pagecache)
1722
+ pagecache).
1724
1723
1725
1724
1726
1725
wchar
@@ -1878,7 +1877,7 @@ For more information on mount propagation see:
1878
1877
1879
1878
3.6 /proc/<pid>/comm & /proc/<pid>/task/<tid>/comm
1880
1879
--------------------------------------------------------
1881
- These files provide a method to access a tasks comm value. It also allows for
1880
+ These files provide a method to access a task's comm value. It also allows for
1882
1881
a task to set its own or one of its thread siblings comm value. The comm value
1883
1882
is limited in size compared to the cmdline value, so writing anything longer
1884
1883
then the kernel's TASK_COMM_LEN (currently 16 chars) will result in a truncated
@@ -1891,21 +1890,21 @@ This file provides a fast way to retrieve first level children pids
1891
1890
of a task pointed by <pid>/<tid> pair. The format is a space separated
1892
1891
stream of pids.
1893
1892
1894
- Note the "first level" here -- if a child has own children they will
1895
- not be listed here, one needs to read /proc/<children-pid>/task/<tid>/children
1893
+ Note the "first level" here -- if a child has its own children they will
1894
+ not be listed here; one needs to read /proc/<children-pid>/task/<tid>/children
1896
1895
to obtain the descendants.
1897
1896
1898
1897
Since this interface is intended to be fast and cheap it doesn't
1899
1898
guarantee to provide precise results and some children might be
1900
1899
skipped, especially if they've exited right after we printed their
1901
- pids, so one need to either stop or freeze processes being inspected
1900
+ pids, so one needs to either stop or freeze processes being inspected
1902
1901
if precise results are needed.
1903
1902
1904
1903
1905
1904
3.8 /proc/<pid>/fdinfo/<fd> - Information about opened file
1906
1905
---------------------------------------------------------------
1907
1906
This file provides information associated with an opened file. The regular
1908
- files have at least three fields -- 'pos', 'flags' and mnt_id. The 'pos'
1907
+ files have at least three fields -- 'pos', 'flags' and ' mnt_id' . The 'pos'
1909
1908
represents the current offset of the opened file in decimal form [see lseek(2)
1910
1909
for details], 'flags' denotes the octal O_xxx mask the file has been
1911
1910
created with [see open(2) for details] and 'mnt_id' represents mount ID of
@@ -1976,7 +1975,7 @@ For inotify files the format is the following::
1976
1975
flags: 02000000
1977
1976
inotify wd:3 ino:9e7e sdev:800013 mask:800afce ignored_mask:0 fhandle-bytes:8 fhandle-type:1 f_handle:7e9e0000640d1b6d
1978
1977
1979
- where 'wd' is a watch descriptor in decimal form, ie a target file
1978
+ where 'wd' is a watch descriptor in decimal form, i.e. a target file
1980
1979
descriptor number, 'ino' and 'sdev' are inode and device where the
1981
1980
target file resides and the 'mask' is the mask of events, all in hex
1982
1981
form [see inotify(7) for more details].
@@ -2003,10 +2002,10 @@ For fanotify files the format is::
2003
2002
where fanotify 'flags' and 'event-flags' are values used in fanotify_init
2004
2003
call, 'mnt_id' is the mount point identifier, 'mflags' is the value of
2005
2004
flags associated with mark which are tracked separately from events
2006
- mask. 'ino', 'sdev' are target inode and device, 'mask' is the events
2005
+ mask. 'ino' and 'sdev' are target inode and device, 'mask' is the events
2007
2006
mask and 'ignored_mask' is the mask of events which are to be ignored.
2008
- All in hex format. Incorporation of 'mflags', 'mask' and 'ignored_mask'
2009
- does provide information about flags and mask used in fanotify_mark
2007
+ All are in hex format. Incorporation of 'mflags', 'mask' and 'ignored_mask'
2008
+ provide information about flags and mask used in fanotify_mark
2010
2009
call [see fsnotify manpage for details].
2011
2010
2012
2011
While the first three lines are mandatory and always printed, the rest is
@@ -2029,7 +2028,7 @@ Timerfd files
2029
2028
where 'clockid' is the clock type and 'ticks' is the number of the timer expirations
2030
2029
that have occurred [see timerfd_create(2) for details]. 'settime flags' are
2031
2030
flags in octal form been used to setup the timer [see timerfd_settime(2) for
2032
- details]. 'it_value' is remaining time until the timer exiration .
2031
+ details]. 'it_value' is remaining time until the timer expiration .
2033
2032
'it_interval' is the interval for the timer. Note the timer might be set up
2034
2033
with TIMER_ABSTIME option which will be shown in 'settime flags', but 'it_value'
2035
2034
still exhibits timer's remaining time.
@@ -2059,13 +2058,13 @@ are actually shared.
2059
2058
3.10 /proc/<pid>/timerslack_ns - Task timerslack value
2060
2059
---------------------------------------------------------
2061
2060
This file provides the value of the task's timerslack value in nanoseconds.
2062
- This value specifies a amount of time that normal timers may be deferred
2061
+ This value specifies an amount of time that normal timers may be deferred
2063
2062
in order to coalesce timers and avoid unnecessary wakeups.
2064
2063
2065
- This allows a task's interactivity vs power consumption trade off to be
2064
+ This allows a task's interactivity vs power consumption tradeoff to be
2066
2065
adjusted.
2067
2066
2068
- Writing 0 to the file will set the tasks timerslack to the default value.
2067
+ Writing 0 to the file will set the task's timerslack to the default value.
2069
2068
2070
2069
Valid values are from 0 - ULLONG_MAX
2071
2070
@@ -2105,10 +2104,10 @@ Example
2105
2104
Description
2106
2105
~~~~~~~~~~~
2107
2106
2108
- x86 specific entries:
2107
+ x86 specific entries
2109
2108
~~~~~~~~~~~~~~~~~~~~~
2110
2109
2111
- AVX512_elapsed_ms:
2110
+ AVX512_elapsed_ms
2112
2111
^^^^^^^^^^^^^^^^^^
2113
2112
2114
2113
If AVX512 is supported on the machine, this entry shows the milliseconds
@@ -2134,8 +2133,8 @@ AVX512_elapsed_ms:
2134
2133
the task is unlikely an AVX512 user, but depends on the workload and the
2135
2134
scheduling scenario, it also could be a false negative mentioned above.
2136
2135
2137
- Configuring procfs
2138
- ------------------
2136
+ Chapter 4: Configuring procfs
2137
+ =============================
2139
2138
2140
2139
4.1 Mount options
2141
2140
---------------------
@@ -2178,8 +2177,8 @@ information about processes information, just add identd to this group.
2178
2177
subset=pid hides all top level files and directories in the procfs that
2179
2178
are not related to tasks.
2180
2179
2181
- 5 Filesystem behavior
2182
- ---------------------------
2180
+ Chapter 5: Filesystem behavior
2181
+ ==============================
2183
2182
2184
2183
Originally, before the advent of pid namepsace, procfs was a global file
2185
2184
system. It means that there was only one procfs instance in the system.
0 commit comments