Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Documentation/filesystems/proc.rst: copy-editing cleanup

Clean up Documentation/filesystems/proc.rst.

This is basically fixing lots of spelling, grammar, punctuation,
typos, spacing, consistency, section numbering, and headings.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://lore.kernel.org/r/a5f126e6-d67a-154a-1c87-d8f07542a21c@infradead.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

authored by

Randy Dunlap and committed by
Jonathan Corbet
059db434 6db35a24

+55 -56
+55 -56
Documentation/filesystems/proc.rst
··· 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 ··· 1623 1624 3.1 /proc/<pid>/oom_adj & /proc/<pid>/oom_score_adj- Adjust the oom-killer score 1624 1625 -------------------------------------------------------------------------------- 1625 1626 1626 - These file can be used to adjust the badness heuristic used to select which 1627 - process gets killed in out of memory conditions. 1627 + These files can be used to adjust the badness heuristic used to select which 1628 + process gets killed in out of memory (oom) conditions. 1628 1629 1629 1630 The badness heuristic assigns a value to each candidate task ranging from 0 1630 1631 (never kill) to 1000 (always kill) to determine which process is targeted. The ··· 1680 1681 3.2 /proc/<pid>/oom_score - Display current oom-killer score 1681 1682 ------------------------------------------------------------- 1682 1683 1683 - This file can be used to check the current score used by the oom-killer is for 1684 + This file can be used to check the current score used by the oom-killer for 1684 1685 any given <pid>. Use it together with /proc/<pid>/oom_score_adj to tune which 1685 1686 process should be killed in an out-of-memory situation. 1686 1687 ··· 1688 1689 3.3 /proc/<pid>/io - Display the IO accounting fields 1689 1690 ------------------------------------------------------- 1690 1691 1691 - This file contains IO statistics for each running process 1692 + This file contains IO statistics for each running process. 1692 1693 1693 1694 Example 1694 1695 ~~~~~~~ ··· 1719 1720 is simply the sum of bytes which this process passed to read() and pread(). 1720 1721 It includes things like tty IO and it is unaffected by whether or not actual 1721 1722 physical disk IO was required (the read might have been satisfied from 1722 - pagecache) 1723 + pagecache). 1723 1724 1724 1725 1725 1726 wchar ··· 1877 1878 1878 1879 3.6 /proc/<pid>/comm & /proc/<pid>/task/<tid>/comm 1879 1880 -------------------------------------------------------- 1880 - These files provide a method to access a tasks comm value. It also allows for 1881 + These files provide a method to access a task's comm value. It also allows for 1881 1882 a task to set its own or one of its thread siblings comm value. The comm value 1882 1883 is limited in size compared to the cmdline value, so writing anything longer 1883 1884 then the kernel's TASK_COMM_LEN (currently 16 chars) will result in a truncated ··· 1890 1891 of a task pointed by <pid>/<tid> pair. The format is a space separated 1891 1892 stream of pids. 1892 1893 1893 - Note the "first level" here -- if a child has own children they will 1894 - not be listed here, one needs to read /proc/<children-pid>/task/<tid>/children 1894 + Note the "first level" here -- if a child has its own children they will 1895 + not be listed here; one needs to read /proc/<children-pid>/task/<tid>/children 1895 1896 to obtain the descendants. 1896 1897 1897 1898 Since this interface is intended to be fast and cheap it doesn't 1898 1899 guarantee to provide precise results and some children might be 1899 1900 skipped, especially if they've exited right after we printed their 1900 - pids, so one need to either stop or freeze processes being inspected 1901 + pids, so one needs to either stop or freeze processes being inspected 1901 1902 if precise results are needed. 1902 1903 1903 1904 1904 1905 3.8 /proc/<pid>/fdinfo/<fd> - Information about opened file 1905 1906 --------------------------------------------------------------- 1906 1907 This file provides information associated with an opened file. The regular 1907 - files have at least three fields -- 'pos', 'flags' and mnt_id. The 'pos' 1908 + files have at least three fields -- 'pos', 'flags' and 'mnt_id'. The 'pos' 1908 1909 represents the current offset of the opened file in decimal form [see lseek(2) 1909 1910 for details], 'flags' denotes the octal O_xxx mask the file has been 1910 1911 created with [see open(2) for details] and 'mnt_id' represents mount ID of ··· 1975 1976 flags: 02000000 1976 1977 inotify wd:3 ino:9e7e sdev:800013 mask:800afce ignored_mask:0 fhandle-bytes:8 fhandle-type:1 f_handle:7e9e0000640d1b6d 1977 1978 1978 - where 'wd' is a watch descriptor in decimal form, ie a target file 1979 + where 'wd' is a watch descriptor in decimal form, i.e. a target file 1979 1980 descriptor number, 'ino' and 'sdev' are inode and device where the 1980 1981 target file resides and the 'mask' is the mask of events, all in hex 1981 1982 form [see inotify(7) for more details]. ··· 2002 2003 where fanotify 'flags' and 'event-flags' are values used in fanotify_init 2003 2004 call, 'mnt_id' is the mount point identifier, 'mflags' is the value of 2004 2005 flags associated with mark which are tracked separately from events 2005 - mask. 'ino', 'sdev' are target inode and device, 'mask' is the events 2006 + mask. 'ino' and 'sdev' are target inode and device, 'mask' is the events 2006 2007 mask and 'ignored_mask' is the mask of events which are to be ignored. 2007 - All in hex format. Incorporation of 'mflags', 'mask' and 'ignored_mask' 2008 - does provide information about flags and mask used in fanotify_mark 2008 + All are in hex format. Incorporation of 'mflags', 'mask' and 'ignored_mask' 2009 + provide information about flags and mask used in fanotify_mark 2009 2010 call [see fsnotify manpage for details]. 2010 2011 2011 2012 While the first three lines are mandatory and always printed, the rest is ··· 2028 2029 where 'clockid' is the clock type and 'ticks' is the number of the timer expirations 2029 2030 that have occurred [see timerfd_create(2) for details]. 'settime flags' are 2030 2031 flags in octal form been used to setup the timer [see timerfd_settime(2) for 2031 - details]. 'it_value' is remaining time until the timer exiration. 2032 + details]. 'it_value' is remaining time until the timer expiration. 2032 2033 'it_interval' is the interval for the timer. Note the timer might be set up 2033 2034 with TIMER_ABSTIME option which will be shown in 'settime flags', but 'it_value' 2034 2035 still exhibits timer's remaining time. ··· 2058 2059 3.10 /proc/<pid>/timerslack_ns - Task timerslack value 2059 2060 --------------------------------------------------------- 2060 2061 This file provides the value of the task's timerslack value in nanoseconds. 2061 - This value specifies a amount of time that normal timers may be deferred 2062 + This value specifies an amount of time that normal timers may be deferred 2062 2063 in order to coalesce timers and avoid unnecessary wakeups. 2063 2064 2064 - This allows a task's interactivity vs power consumption trade off to be 2065 + This allows a task's interactivity vs power consumption tradeoff to be 2065 2066 adjusted. 2066 2067 2067 - Writing 0 to the file will set the tasks timerslack to the default value. 2068 + Writing 0 to the file will set the task's timerslack to the default value. 2068 2069 2069 2070 Valid values are from 0 - ULLONG_MAX 2070 2071 ··· 2104 2105 Description 2105 2106 ~~~~~~~~~~~ 2106 2107 2107 - x86 specific entries: 2108 + x86 specific entries 2108 2109 ~~~~~~~~~~~~~~~~~~~~~ 2109 2110 2110 - AVX512_elapsed_ms: 2111 + AVX512_elapsed_ms 2111 2112 ^^^^^^^^^^^^^^^^^^ 2112 2113 2113 2114 If AVX512 is supported on the machine, this entry shows the milliseconds ··· 2133 2134 the task is unlikely an AVX512 user, but depends on the workload and the 2134 2135 scheduling scenario, it also could be a false negative mentioned above. 2135 2136 2136 - Configuring procfs 2137 - ------------------ 2137 + Chapter 4: Configuring procfs 2138 + ============================= 2138 2139 2139 2140 4.1 Mount options 2140 2141 --------------------- ··· 2177 2178 subset=pid hides all top level files and directories in the procfs that 2178 2179 are not related to tasks. 2179 2180 2180 - 5 Filesystem behavior 2181 - --------------------------- 2181 + Chapter 5: Filesystem behavior 2182 + ============================== 2182 2183 2183 2184 Originally, before the advent of pid namepsace, procfs was a global file 2184 2185 system. It means that there was only one procfs instance in the system.