• Home
  • Raw
  • Download

Lines Matching +full:loss +full:- +full:of +full:- +full:signal

1 .. SPDX-License-Identifier: GPL-2.0
17 .. Table of Contents
24 1.1 Process-Specific Subdirectories
36 3 Per-Process Parameters
37 3.1 /proc/<pid>/oom_adj & /proc/<pid>/oom_score_adj - Adjust the oom-killer
39 3.2 /proc/<pid>/oom_score - Display current oom-killer score
40 3.3 /proc/<pid>/io - Display the IO accounting fields
41 3.4 /proc/<pid>/coredump_filter - Core dump filtering settings
42 3.5 /proc/<pid>/mountinfo - Information about mounts
44 3.7 /proc/<pid>/task/<tid>/children - Information about task children
45 3.8 /proc/<pid>/fdinfo/<fd> - Information about opened file
46 3.9 /proc/<pid>/map_files - Information about memory mapped files
47 3.10 /proc/<pid>/timerslack_ns - Task timerslack value
48 3.11 /proc/<pid>/patch_state - Livepatch patch operation state
49 3.12 /proc/<pid>/arch_status - Task architecture specific information
50 3.13 /proc/<pid>/fd - List of symlinks to open files
61 ------------------------
63 This documentation is part of a soon (or so we hope) to be released book on
69 we know, it is the first 'all-in-one' document about the /proc file system. It
72 It also only covers IPv4 networking, not IPv6 nor other protocols - sorry. But
76 We'd like to thank Alan Cox, Rik van Riel, and Alexey Kuznetsov and a lot of
81 and helped create a great piece of software... :)
87 The latest version of this document is available online at
91 mailing list at linux-kernel@vger.kernel.org and/or try to reach me at
95 ---------------
97 We don't guarantee the correctness of this document, and if you come to us
98 complaining about how you screwed up your system because of incorrect
105 ---------------
106 * Investigating the properties of the pseudo file system /proc and its
112 ------------------------------------------------------------------------------
118 First, we'll take a look at the read-only parts of /proc. In Chapter 2, we
121 1.1 Process-Specific Subdirectories
122 -----------------------------------
128 subdirectory has the entries listed in Table 1-1.
130 Note that an open file descriptor to /proc/<pid> or to any of its
138 .. table:: Table 1-1: Process specific entries in /proc
147 environ Values of environment variables
148 exe Link to the executable of this process
152 root Link to the root directory of this process
157 symbol the task is blocked in - or "0" if not blocked.
160 smaps An extension based on maps, showing the memory consumption of
162 smaps_rollup Accumulated smaps stats for all mappings of the process. This
165 binding policy as well as mem usage (in pages) of each mapping.
168 For example, to get the status information of a process, all you have to do is
221 information. But you get a more detailed view of the process by reading the
222 file /proc/PID/status. It fields are described in table 1-2.
225 memory usage. Its seven fields are explained in Table 1-3. The stat file
227 explained in Table 1-4.
233 snapshot of a moment, you can see /proc/<pid>/smaps file and scan page table.
236 .. table:: Table 1-2: Contents of the status fields (as of 4.19)
241 Name filename of the executable
249 PPid process id of the parent process
250 TracerPid PID of process tracing this process (0 if not, or
251 the tracer is outside of the current pid namespace)
254 FDSize number of file descriptor slots currently allocated
266 VmRSS size of memory portions. It contains the three
269 RssAnon size of resident anonymous memory
270 RssFile size of resident file mappings
271 RssShmem size of resident shmem memory (includes SysV shm,
272 mapping of tmpfs and shared anonymous mappings)
273 VmData size of private data segments
274 VmStk size of stack segments
275 VmExe size of text segment
276 VmLib size of shared library code
277 VmPTE size of page table entries
278 VmSwap amount of swap used by anonymous private data
280 HugetlbPages size of hugetlb memory portions
285 Threads number of threads
286 SigQ number of signals queued/max. number for queue
287 SigPnd bitmap of pending signals for the thread
288 ShdPnd bitmap of shared pending signals for the process
289 SigBlk bitmap of blocked signals
290 SigIgn bitmap of ignored signals
291 SigCgt bitmap of caught signals
292 CapInh bitmap of inheritable capabilities
293 CapPrm bitmap of permitted capabilities
294 CapEff bitmap of effective capabilities
295 CapBnd bitmap of capabilities bounding set
296 CapAmb bitmap of ambient capabilities
301 Cpus_allowed mask of CPUs on which this process may run
303 Mems_allowed mask of memory nodes allowed to this process
305 voluntary_ctxt_switches number of voluntary context switches
306 nonvoluntary_ctxt_switches number of non voluntary context switches
310 .. table:: Table 1-3: Contents of the statm fields (as of 2.6.8-rc3)
316 resident size of memory portions (pages) (same as VmRSS in status)
317 shared number of pages that are shared (i.e. backed by a file, same
319 trs number of pages that are 'code' (not including libs; broken,
321 lrs number of pages of library (always 0 on 2.6)
322 drs number of pages of data/stack (including libs; broken,
324 dt number of dirty pages (always 0 on 2.6)
328 .. table:: Table 1-4: Contents of the stat fields (as of 2.6.30-rc7)
334 tcomm filename of the executable
337 ppid process id of the parent process
338 pgrp pgrp of the process
341 tty_pgrp pgrp of the tty
343 min_flt number of minor faults
344 cmin_flt number of minor faults with child's
345 maj_flt number of major faults
346 cmaj_flt number of major faults with child's
353 num_threads number of threads
361 start_stack address of the start of the main process stack
362 esp current value of ESP
363 eip current value of EIP
364 pending bitmap of pending signals
365 blocked bitmap of blocked signals
366 sigign bitmap of ignored signals
367 sigcatch bitmap of caught signals
372 exit_signal signal to send to parent thread on exit
377 gtime guest time of the task in jiffies
378 cgtime guest time of the task children in jiffies
397 08048000-08049000 r-xp 00000000 03:00 8312 /opt/test
398 08049000-0804a000 rw-p 00001000 03:00 8312 /opt/test
399 0804a000-0806b000 rw-p 00000000 00:00 0 [heap]
400 a7cb1000-a7cb2000 ---p 00000000 00:00 0
401 a7cb2000-a7eb2000 rw-p 00000000 00:00 0
402 a7eb2000-a7eb3000 ---p 00000000 00:00 0
403 a7eb3000-a7ed5000 rw-p 00000000 00:00 0
404 a7ed5000-a8008000 r-xp 00000000 03:00 4222 /lib/libc.so.6
405 a8008000-a800a000 r--p 00133000 03:00 4222 /lib/libc.so.6
406 a800a000-a800b000 rw-p 00135000 03:00 4222 /lib/libc.so.6
407 a800b000-a800e000 rw-p 00000000 00:00 0
408 a800e000-a8022000 r-xp 00000000 03:00 14462 /lib/libpthread.so.0
409 a8022000-a8023000 r--p 00013000 03:00 14462 /lib/libpthread.so.0
410 a8023000-a8024000 rw-p 00014000 03:00 14462 /lib/libpthread.so.0
411 a8024000-a8027000 rw-p 00000000 00:00 0
412 a8027000-a8043000 r-xp 00000000 03:00 8317 /lib/ld-linux.so.2
413 a8043000-a8044000 r--p 0001b000 03:00 8317 /lib/ld-linux.so.2
414 a8044000-a8045000 rw-p 0001c000 03:00 8317 /lib/ld-linux.so.2
415 aff35000-aff4a000 rw-p 00000000 00:00 0 [stack]
416 ffffe000-fffff000 r-xp 00000000 00:00 0 [vdso]
419 is a set of permissions::
434 [heap] the heap of the program
435 [stack] the stack of the main process
447 ioctl()-based API that gives ability to flexibly and efficiently query and
456 consumption for each of the process's mappings. For each mapping (aka Virtual
457 Memory Area, or VMA) there is a series of lines such as the following::
459 08048000-080bc000 r-xp 00000000 03:02 13130 /bin/bash
487 The first of these lines shows the same information as is displayed for the
488 mapping in /proc/PID/maps. Following lines show the size of the mapping
489 (size); the size of each page allocated when backing a VMA (KernelPageSize),
492 the amount of the mapping that is currently resident in RAM (RSS); the
493 process' proportional share of this mapping (PSS); and the number of clean and
496 The "proportional set size" (PSS) of a process is the count of pages it has
497 in memory, where each page is divided by the number of processes sharing it.
499 process, its PSS will be 1500. "Pss_Dirty" is the portion of PSS which
500 consists of dirty pages. ("Pss_Clean" is not included, but it can be
503 Note that even a page which is part of a MAP_SHARED mapping, but has only
507 "Referenced" indicates the amount of memory currently marked as referenced or
510 "Anonymous" shows the amount of memory that does not belong to any file. Even
514 "KSM" reports how many of the pages are KSM pages. Note that KSM-placed zeropages
517 "LazyFree" shows the amount of memory which is marked by madvise(MADV_FREE).
523 "AnonHugePages" shows the amount of memory backed by transparent hugepage.
525 "ShmemPmdMapped" shows the amount of shared (shmem/tmpfs) memory backed by
528 "Shared_Hugetlb" and "Private_Hugetlb" show the amounts of memory backed by
532 "Swap" shows how much would-be-anonymous memory is also used, but out on swap.
534 For shmem mappings, "Swap" includes also the size of the mapped (and not
535 replaced by copy-on-write) part of the underlying shmem object out on swap.
536 "SwapPss" shows proportional swap share of this mapping. Unlike "Swap", this
537 does not take into account swapped out page of underlying shmem objects.
541 naturally aligned THP pages of any currently enabled size. 1 if true, 0
581 uw userfaultfd wr-protect tracking
588 be vanished or the reverse -- new added. Interpretation of their meaning
589 might change in future as well. So each consumer of these flags has to
598 This typically manifests when doing partial reads of these files while the
604 2) If there is something at a given vaddr during the entirety of the
605 life of the smaps/maps walk, there will be some output for it.
608 but their values are the sums of the corresponding values for all mappings of
611 - Pss_Anon
612 - Pss_File
613 - Pss_Shmem
615 They represent the proportional shares of anonymous, file, and shmem pages, as
617 mapping identifies the type (anon, file, or shmem) of all pages it contains.
623 soft-dirty bit on pte (see Documentation/admin-guide/mm/soft-dirty.rst
637 To clear the soft-dirty bit::
649 using /proc/kpageflags and number of times a page is mapped using
651 Documentation/admin-guide/mm/pagemap.rst.
654 locality and binding policy, as well as the memory usage (in pages) of
662 3206000000 default file=/lib64/ld-2.12.so mapped=26 mapmax=6 N0=24 N3=2 kernelpagesize_kB=4
663 320621f000 default file=/lib64/ld-2.12.so anon=1 dirty=1 N3=1 kernelpagesize_kB=4
664 3206220000 default file=/lib64/ld-2.12.so anon=1 dirty=1 N3=1 kernelpagesize_kB=4
666 …3206800000 default file=/lib64/libc-2.12.so mapped=59 mapmax=21 active=55 N0=41 N3=18 kernelpagesi…
667 320698b000 default file=/lib64/libc-2.12.so
668 3206b8a000 default file=/lib64/libc-2.12.so anon=2 dirty=2 N3=2 kernelpagesize_kB=4
669 3206b8e000 default file=/lib64/libc-2.12.so anon=1 dirty=1 N3=1 kernelpagesize_kB=4
681 "policy" reports the NUMA memory policy set for the mapping (see Documentation/admin-guide/mm/numa_…
688 ---------------
692 /proc and are listed in Table 1-5. Not all of these will be present in your
696 .. table:: Table 1-5: Kernel info in /proc
729 loadavg Load average of last 1, 5 & 15 minutes;
730 number of processes currently runnable (running or on ready queue);
731 total number of processes in system;
733 All fields are separated by one space except "number of
734 processes currently runnable" and "total number of processes
740 modules List of loaded modules
744 partitions Table of partitions known to the system
745 pci Deprecated info of PCI bus (new way -> /proc/bus/pci/,
754 sysvipc Info of SysVIPC Resources (msg, sem, shm) (2.4)
755 tty Info of tty drivers
756 uptime Wall clock since boot, combined idle time of all cpus
758 video bttv info of video resources (2.4)
767 0: 8728810 XT-PIC timer
768 1: 895 XT-PIC keyboard
769 2: 0 XT-PIC cascade
770 3: 531695 XT-PIC aha152x
771 4: 2014133 XT-PIC serial
772 5: 44401 XT-PIC pcnet_cs
773 8: 2 XT-PIC rtc
774 11: 8 XT-PIC i82365
775 12: 182918 XT-PIC PS/2 Mouse
776 13: 1 XT-PIC fpu
777 14: 1232265 XT-PIC ide0
778 15: 7 XT-PIC ide1
781 In 2.4.* a couple of lines where added to this file LOC & ERR (this time is the
782 output of a SMP machine)::
787 0: 1243498 1214548 IO-APIC-edge timer
788 1: 8949 8958 IO-APIC-edge keyboard
789 2: 0 0 XT-PIC cascade
790 5: 11286 10161 IO-APIC-edge soundblaster
791 8: 1 0 IO-APIC-edge rtc
792 9: 27422 27407 IO-APIC-edge 3c503
793 12: 113645 113873 IO-APIC-edge PS/2 Mouse
794 13: 0 0 XT-PIC fpu
795 14: 22491 24012 IO-APIC-edge ide0
796 15: 2183 2415 IO-APIC-edge ide1
797 17: 30564 30414 IO-APIC-level eth0
798 18: 177 164 IO-APIC-level bttv
806 LOC is the local interrupt counter of the internal APIC of every CPU.
808 ERR is incremented in the case of errors in the IO-APIC bus (the bus that
810 the IO-APIC automatically retry the transmission, so it should not be a big
811 problem, but you should read the SMP-FAQ.
819 (typically counting ECC corrected errors of memory or cache) exceeds
832 of 0xff. This might also be generated by chipset bugs.
836 sent from one CPU to another per the needs of the OS. Typically,
838 determine the occurrence of interrupts of the given type.
842 suppressed when the system is a uniprocessor. As of this writing, only
845 Of some interest is the introduction of the /proc/irq directory to 2.4.
847 IRQ to only one CPU, or to exclude a CPU of handling IRQs. The contents of the
867 The contents of each smp_affinity file is the same by default::
873 a CPU range instead of a bitmask::
876 1024-1031
878 The default_smp_affinity mask applies to all non-active IRQs, which are the
880 /proc/irq/[0-9]* directory.
887 profiler. Default value is ffffffff (all CPUs if there are only 32 of them).
889 The way IRQs are routed is handled by the IO-APIC, and it's Round Robin
892 best choice for almost everyone. [Note this applies only to those IO-APIC's
896 The general rule is that the contents, or even the existence of these
919 Each column represents the number of pages of a certain order which are
920 available. In this case, there are 0 chunks of 2^0*PAGE_SIZE available in
921 ZONE_DMA, 4 chunks of 2^1*PAGE_SIZE in ZONE_DMA, 101 chunks of 2^4*PAGE_SIZE
943 Number of blocks type Unmovable Reclaimable Movable Reserve Isolate
947 Fragmentation avoidance in the kernel works by grouping pages of different
948 migrate types into the same contiguous regions of memory called page blocks.
949 A page block is typically the size of the default hugepage size, e.g. 2MB on
950 X86-64. By keeping pages grouped based on their ability to move, the kernel
951 can reclaim pages within a page block to satisfy a high-order allocation.
953 The pagetypinfo begins with information on the size of a page block. It
954 then gives the same type of information as buddyinfo except broken down
955 by migrate-type and finishes with details on how many page blocks of each
960 make an estimate of the likely number of huge pages that can be allocated
962 unless memory has been mlock()'d. Some of the Reclaimable blocks should
963 also be allocatable although a lot of filesystem metadata may have to be
973 the allocation. The number of bytes allocated and number of calls at each
974 location are reported. The first line indicates the version of the file, the
981 > tail -n +3 /proc/allocinfo | sort -rn
986 13377536 234 block/blk-mq.c:3421 func:blk_mq_alloc_rqs
999 Provides information about distribution and utilization of memory. This
1000 varies by architecture and compile options. Some of the counters reported
1007 Example output. You may not have all of these fields.
1075 Total free RAM. On highmem systems, the sum of LowFree+HighFree
1077 An estimate of how much memory is available for starting new
1079 SReclaimable, the size of the file LRU lists, and the low
1084 impact of those factors will vary from system to system.
1089 In-memory cache for files read from the disk (the
1109 Highmem is all memory above ~860MB of physical memory.
1118 allocated. Bad things happen when you're out of lowmem.
1120 total amount of swap space available
1127 Amount of anonymous memory stored in zswap (original size)
1133 Non-file backed pages mapped into userspace page tables
1143 in-kernel data structures cache
1145 Part of Slab, that might be reclaimed, such as caches
1147 Part of Slab, that cannot be reclaimed on memory pressure
1149 Memory consumed by the kernel stacks of all tasks
1164 this is the total amount of memory currently available to
1171 CommitLimit = ([total RAM pages] - [total huge TLB pages]) *
1174 For example, on a system with 1G of physical RAM and 7G
1175 of swap with a `vm.overcommit_ratio` of 30 it would
1176 yield a CommitLimit of 7.3G.
1179 in mm/overcommit-accounting.
1181 The amount of memory presently allocated on the system.
1182 The committed memory is a sum of all of the memory which
1184 "used" by them as of yet. A process which malloc()'s 1G
1185 of memory, but only touches 300M of it will show up as
1192 not fail due to lack of memory once that memory has been
1195 total size of vmalloc virtual address space
1197 amount of vmalloc area which is used
1199 largest contiguous block of vmalloc area which is free
1202 allocations. This stat excludes the cost of metadata.
1204 The amount of RAM/memory in kB, that was identified as corrupted
1208 there was at least one pass of memtest and none of the passes
1209 found a single faulty byte of RAM.
1211 The amount of RAM/memory in KB, the kernel identifies as
1214 Non-file backed huge pages mapped into userspace page tables
1230 See Documentation/admin-guide/mm/hugetlbpage.rst.
1232 Breakdown of page table sizes used in the kernel's
1233 identity mapping of RAM
1239 containing the virtual address range of the area, size in bytes,
1240 caller information of the creator, and optional information depending
1241 on the kind of area:
1244 pages=nr number of pages
1252 Number of pages allocated on memory node <node>
1258 0xffffc20000000000-0xffffc20000201000 2101248 alloc_large_system_hash+0x204 ...
1260 0xffffc20000201000-0xffffc20000302000 1052672 alloc_large_system_hash+0x204 ...
1262 0xffffc20000302000-0xffffc20000304000 8192 acpi_tb_verify_table+0x21/0x4f...
1264 0xffffc20000304000-0xffffc20000307000 12288 acpi_tb_verify_table+0x21/0x4f...
1266 0xffffc2000031d000-0xffffc2000031f000 8192 init_vdso_vars+0x112/0x210
1267 0xffffc2000031f000-0xffffc2000032b000 49152 cramfs_uncompress_init+0x2e ...
1269 0xffffc2000033a000-0xffffc2000033d000 12288 sys_swapon+0x640/0xac0 ...
1271 0xffffc20000347000-0xffffc2000034c000 20480 xt_alloc_table_info+0xfe ...
1273 0xffffffffa0000000-0xffffffffa000f000 61440 sys_init_module+0xc27/0x1d00 ...
1275 0xffffffffa000f000-0xffffffffa0014000 20480 sys_init_module+0xc27/0x1d00 ...
1277 0xffffffffa0014000-0xffffffffa0017000 12288 sys_init_module+0xc27/0x1d00 ...
1279 0xffffffffa0017000-0xffffffffa0022000 45056 sys_init_module+0xc27/0x1d00 ...
1286 Provides counts of softirq handlers serviced since boot time, for each CPU.
1303 --------------------------------
1305 The subdirectory /proc/net follows the usual pattern. Table 1-8 shows the
1307 support this. Table 1-9 lists the files and their meaning.
1310 .. table:: Table 1-8: IPv6 info in /proc/net
1319 if_inet6 List of IPv6 interface addresses
1326 .. table:: Table 1-9: Network info in /proc/net
1334 (interface index, label, number of references, number of bound
1348 softnet_stat Per-CPU incoming packets queues statistics of online CPUs
1355 netlink List of PF_NETLINK sockets
1356 ip_mr_vifs List of multicast virtual interfaces
1357 ip_mr_cache List of multicast routing cache
1364 Inter-|Receive |[...
1379 current slaves of the bond, the link status of the slaves, and how
1383 -------------
1387 You'll also see a list of all recognized SCSI devices in /proc/scsi::
1393 Type: Direct-Access ANSI SCSI revision: 03
1395 Vendor: PIONEER Model: CD-ROM DR-U06S Rev: 1.04
1396 Type: CD-ROM ANSI SCSI revision: 02
1401 the used IRQ and the IO address range. The amount of information shown is
1403 AHA-2940 SCSI adapter::
1413 SCSI Adapter: Adaptec AHA-294X Ultra SCSI host adapter
1446 ---------------------------------------
1448 The directory /proc/parport contains information about the parallel ports of
1452 These directories contain the four files shown in Table 1-10.
1455 .. table:: Table 1-10: Files in /proc/parport
1460 autoprobe Any IEEE-1284 device ID information that has been acquired.
1461 devices list of the device drivers using that port. A + will appear by the
1462 name of the device currently using the port (it might not appear
1471 -------------------------
1475 this directory, as shown in Table 1-11.
1478 .. table:: Table 1-11: Files in /proc/tty
1483 drivers list of drivers and their usage
1485 driver/serial usage statistic and status of single tty lines
1492 pty_slave /dev/pts 136 0-255 pty:slave
1493 pty_master /dev/ptm 128 0-255 pty:master
1494 pty_slave /dev/ttyp 3 0-255 pty:slave
1495 pty_master /dev/pty 2 0-255 pty:master
1496 serial /dev/cua 5 64-67 serial:callout
1497 serial /dev/ttyS 4 64-67 serial
1502 unknown /dev/tty 4 1-63 console
1506 -------------------------------------------------
1508 Various pieces of information about kernel activity are available in the
1509 /proc/stat file. All of the numbers reported in this file are aggregates
1526 The very first "cpu" line aggregates the numbers in all of the other "cpuN"
1527 lines. These numbers identify the amount of time the CPU has spent performing
1528 different kinds of work. Time units are in USER_HZ (typically hundredths of a
1529 second). The meanings of the columns are as follows, from left to right:
1531 - user: normal processes executing in user mode
1532 - nice: niced processes executing in user mode
1533 - system: processes executing in kernel mode
1534 - idle: twiddling thumbs
1535 - iowait: In a word, iowait stands for waiting for I/O to complete. But there
1541 2. In a multi-core CPU, the task waiting for I/O to complete is not running
1542 on any CPU, so the iowait of each CPU is difficult to calculate.
1543 3. The value of iowait field in /proc/stat will decrease in certain
1547 - irq: servicing interrupts
1548 - softirq: servicing softirqs
1549 - steal: involuntary wait
1550 - guest: running a normal guest
1551 - guest_nice: running a niced guest
1553 The "intr" line gives counts of interrupts serviced since boot time, for each
1554 of the possible system interrupts. The first column is the total of all
1559 The "ctxt" line gives the total number of context switches across all CPUs.
1564 The "processes" line gives the number of processes and threads created, which
1568 The "procs_running" line gives the total number of threads that are
1569 running or ready to run (i.e., the total number of runnable threads).
1571 The "procs_blocked" line gives the number of processes currently blocked,
1574 The "softirq" line gives counts of softirqs serviced since boot time, for each
1575 of the possible system softirqs. The first column is the total of all
1581 -------------------------------
1586 /proc/fs/ext4/sda9 or /proc/fs/ext4/dm-0). The files in each per-device
1587 directory are shown in Table 1-12, below.
1589 .. table:: Table 1-12: Files in /proc/fs/ext4/<devname>
1593 mb_groups details of multiblock allocator buddy cache of free blocks
1597 -------------------
1604 tty0 -WU (ECp) 4:7
1605 ttyS0 -W- (Ep) 4:64
1609 +--------------------+-------------------------------------------------------+
1610 | device | name of the device |
1615 +--------------------+-------------------------------------------------------+
1622 +--------------------+-------------------------------------------------------+
1623 | major:minor | major and minor number of the device separated by a |
1625 +--------------------+-------------------------------------------------------+
1628 -------
1634 The directory structure of /proc reflects the types of information and makes
1641 ---------------
1645 * Review of the /proc/sys file tree
1647 ------------------------------------------------------------------------------
1649 A very interesting part of /proc is the directory /proc/sys. This is not only
1650 a source of information, it also allows you to change parameters within the
1662 general things in the operation of the Linux kernel. Since some of the files
1665 very careful when writing to any of these files. The entries in /proc may
1669 kernels, and became part of it in version 2.2.1 of the Linux kernel.
1671 Please see: Documentation/admin-guide/sysctl/ directory for descriptions of
1675 -------
1677 Certain aspects of kernel behavior can be modified at runtime, without the
1681 of the kernel.
1684 Chapter 3: Per-process Parameters
1687 3.1 /proc/<pid>/oom_adj & /proc/<pid>/oom_score_adj- Adjust the oom-killer score
1688 --------------------------------------------------------------------------------
1691 process gets killed in out of memory (oom) conditions.
1695 units are roughly a proportion along that range of allowed memory the process
1696 may allocate from based on an estimation of its current memory and swap use.
1698 1000. If it is using half of its allowed memory, its score will be 500.
1700 The amount of "allowed" memory depends on the context in which the oom killer
1702 being exhausted, the allowed memory represents the set of mems assigned to that
1704 memory represents the set of mempolicy nodes. If it is due to a memory
1706 limit. Finally, if it is due to the entire system being out of memory, the
1709 The value of /proc/<pid>/oom_score_adj is added to the badness score before it
1710 is used to determine which task to kill. Acceptable values range from -1000
1713 task or completely disabling it. The lowest possible value, -1000, is
1715 report a badness score of 0.
1717 Consequently, it is very simple for userspace to define the amount of memory to
1718 consider for each task. Setting a /proc/<pid>/oom_score_adj value of +500, for
1719 example, is roughly equivalent to allowing the remainder of tasks sharing the
1721 50% more memory. A value of -500, on the other hand, would be roughly
1722 equivalent to discounting 50% of the task's allowed memory from being considered
1726 be used to tune the badness score. Its acceptable values range from -16
1727 (OOM_ADJUST_MIN) to +15 (OOM_ADJUST_MAX) and a special value of -17
1731 The value of /proc/<pid>/oom_score_adj may be reduced no lower than the last
1736 3.2 /proc/<pid>/oom_score - Display current oom-killer score
1737 -------------------------------------------------------------
1739 This file can be used to check the current score used by the oom-killer for
1741 process should be killed in an out-of-memory situation.
1747 3.3 /proc/<pid>/io - Display the IO accounting fields
1748 -------------------------------------------------------
1757 test:/tmp # dd if=/dev/zero of=/tmp/test.dat &
1777 The number of bytes which this task has caused to be read from storage. This
1778 is simply the sum of bytes which this process passed to read() and pread().
1788 The number of bytes which this task has caused, or shall cause to be written
1796 Attempt to count the number of read I/O operations, i.e. syscalls like read()
1804 Attempt to count the number of write I/O operations, i.e. syscalls like
1812 Attempt to count the number of bytes which this process really did cause to
1814 accurate for block-backed filesystems. <please add status regarding NFS and
1822 Attempt to count the number of bytes which this process caused to be sent to
1823 the storage layer. This is done at page-dirtying time.
1831 been accounted as having caused 1MB of write.
1832 In other words: The number of bytes which this process caused to not happen,
1836 from the truncating task's write_bytes, but there is information loss in doing
1842 At its current implementation state, this is a bit racy on 32-bit machines:
1844 of those 64-bit counters, process A could see an intermediate result.
1850 3.4 /proc/<pid>/coredump_filter - Core dump filtering settings
1851 ---------------------------------------------------------------
1853 long as the size of the core file isn't limited. But sometimes we don't want
1855 Conversely, sometimes we want to save file-backed memory segments into a core
1860 of memory types. If a bit of the bitmask is set, memory segments of the
1865 - (bit 0) anonymous private memory
1866 - (bit 1) anonymous shared memory
1867 - (bit 2) file-backed private memory
1868 - (bit 3) file-backed shared memory
1869 - (bit 4) ELF header pages in file-backed private memory areas (it is
1871 - (bit 5) hugetlb private memory
1872 - (bit 6) hugetlb shared memory
1873 - (bit 7) DAX private memory
1874 - (bit 8) DAX shared memory
1877 are always dumped regardless of the bitmask status.
1879 Note that bits 0-4 don't affect hugetlb or DAX memory. hugetlb memory is
1880 only affected by bit 5-6, and DAX is only affected by bits 7-8.
1882 The default value of coredump_filter is 0x33; this means all anonymous memory
1897 3.5 /proc/<pid>/mountinfo - Information about mounts
1898 --------------------------------------------------------
1900 This file contains lines of the form::
1902 36 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue
1905 (1) mount ID: unique identifier of the mount (may be reused after umount)
1906 (2) parent ID: ID of parent (or of self for the top of the mount tree)
1907 (3) major:minor: value of st_dev for files on filesystem
1908 (4) root: root of the mount within the filesystem
1911 (n…m) optional fields: zero or more fields of the form "tag[:value]"
1912 (m+1) separator: marks the end of the optional fields
1913 (m+2) filesystem type: name of filesystem of the form "type[.subtype]"
1928 X is the immediate master of the mount, or if there's no dominant peer
1938 --------------------------------------------------------
1940 a task to set its own or one of its thread siblings comm value. The comm value
1946 3.7 /proc/<pid>/task/<tid>/children - Information about task children
1947 -------------------------------------------------------------------------
1949 of a task pointed by <pid>/<tid> pair. The format is a space separated
1950 stream of pids.
1952 Note the "first level" here -- if a child has its own children they will
1953 not be listed here; one needs to read /proc/<children-pid>/task/<tid>/children
1963 3.8 /proc/<pid>/fdinfo/<fd> - Information about opened file
1964 ---------------------------------------------------------------
1966 files have at least four fields -- 'pos', 'flags', 'mnt_id' and 'ino'.
1967 The 'pos' represents the current offset of the opened file in decimal
1970 mount ID of the file system containing the opened file [see 3.5
1971 /proc/<pid>/mountinfo for details]. 'ino' represents the inode number of
1997 eventfd-count: 5a
1999 where 'eventfd-count' is hex value of a counter.
2012 where 'sigmask' is hex value of the signal mask associated
2030 The 'pos' is current offset of the target file in decimal form
2042 …inotify wd:3 ino:9e7e sdev:800013 mask:800afce ignored_mask:0 fhandle-bytes:8 fhandle-type:1 f_han…
2046 target file resides and the 'mask' is the mask of events, all in hex
2051 fields 'fhandle-bytes', 'fhandle-type' and 'f_handle', all in hex
2065 fanotify flags:10 event-flags:0
2067 …fanotify ino:4f969 sdev:800013 mflags:0 mask:3b ignored_mask:40000000 fhandle-bytes:8 fhandle-type…
2069 where fanotify 'flags' and 'event-flags' are values used in fanotify_init
2070 call, 'mnt_id' is the mount point identifier, 'mflags' is the value of
2073 mask and 'ignored_mask' is the mask of events which are to be ignored.
2074 All are in hex format. Incorporation of 'mflags', 'mask' and 'ignored_mask'
2096 where 'clockid' is the clock type and 'ticks' is the number of the timer expirations
2115 exp_name: system-heap
2117 where 'size' is the size of the DMA buffer in bytes. 'count' is the file count of
2118 the DMA buffer file. 'exp_name' is the name of the DMA buffer exporter.
2120 3.9 /proc/<pid>/map_files - Information about memory mapped files
2121 ---------------------------------------------------------------------
2125 | lr-------- 1 root root 64 Jan 27 11:24 333c600000-333c620000 -> /usr/lib64/ld-2.18.so
2126 | lr-------- 1 root root 64 Jan 27 11:24 333c81f000-333c820000 -> /usr/lib64/ld-2.18.so
2127 | lr-------- 1 root root 64 Jan 27 11:24 333c820000-333c821000 -> /usr/lib64/ld-2.18.so
2129 | lr-------- 1 root root 64 Jan 27 11:24 35d0421000-35d0422000 -> /usr/lib64/libselinux.so.1
2130 | lr-------- 1 root root 64 Jan 27 11:24 400000-41a000 -> /usr/bin/ls
2132 The name of a link represents the virtual memory bounds of a mapping, i.e.
2133 vm_area_struct::vm_start-vm_area_struct::vm_end.
2135 The main purpose of the map_files is to retrieve a set of memory mapped
2136 files in a fast way instead of parsing /proc/<pid>/maps or
2137 /proc/<pid>/smaps, both of which contain many more records. At the same
2138 time one can open(2) mappings from the listings of two processes and
2142 3.10 /proc/<pid>/timerslack_ns - Task timerslack value
2143 ---------------------------------------------------------
2144 This file provides the value of the task's timerslack value in nanoseconds.
2145 This value specifies an amount of time that normal timers may be deferred
2153 Valid values are from 0 - ULLONG_MAX
2158 3.11 /proc/<pid>/patch_state - Livepatch patch operation state
2159 -----------------------------------------------------------------
2160 When CONFIG_LIVEPATCH is enabled, this file displays the value of the
2163 A value of '-1' indicates that no patch is in transition.
2165 A value of '0' indicates that a patch is in transition and the task is
2170 A value of '1' indicates that a patch is in transition and the task is
2175 3.12 /proc/<pid>/arch_status - task architecture specific status
2176 -------------------------------------------------------------------
2178 architecture specific status of the task.
2212 of the overall scenario on the system in order to determine whether a
2216 A special value of '-1' indicates that no AVX512 usage was recorded, thus
2220 3.13 /proc/<pid>/fd - List of symlinks to open files
2221 -------------------------------------------------------
2225 lr-x------ 1 root root 64 Sep 20 17:53 0 -> /dev/null
2226 l-wx------ 1 root root 64 Sep 20 17:53 1 -> /dev/null
2227 lrwx------ 1 root root 64 Sep 20 17:53 10 -> 'socket:[12539]'
2228 lrwx------ 1 root root 64 Sep 20 17:53 11 -> 'socket:[12540]'
2229 lrwx------ 1 root root 64 Sep 20 17:53 12 -> 'socket:[12542]'
2231 The number of open files for the process is stored in 'size' member
2232 of stat() output for /proc/<pid>/fd for fast access.
2233 -------------------------------------------------------
2240 ---------------------
2247 subset= Show only the specified subset of procfs.
2250 hidepid=off or hidepid=0 means classic mode - everybody may access all
2264 by "kill -0 $PID"), but it hides process' uid and gid, which may be learned by
2265 stat()'ing /proc/<pid>/ otherwise. It greatly complicates an intruder's task of
2283 Originally, before the advent of pid namespace, procfs was a global file
2293 # strace -e mount mount -o hidepid=1 -t proc proc /tmp/proc
2304 # mount -o remount,hidepid=1 -t proc proc /tmp/proc
2310 This behavior is different from the behavior of other filesystems.
2317 # mount -o hidepid=invisible -t proc proc /proc
2318 # mount -o hidepid=noaccess -t proc proc /tmp/proc