proc.rst (98817a84ff1c755c347ac633ff017a623a631fad) | proc.rst (059db4341303922b6181df4b58c05f22d33b2f4f) |
---|---|
1.. SPDX-License-Identifier: GPL-2.0 2 3==================== 4The /proc Filesystem 5==================== 6 7===================== ======================================= ================ 8/proc/sys Terrehon Bowden <terrehon@pacbell.net>, October 7 1999 --- 109 unchanged lines hidden (view full) --- 118show you how you can use /proc/sys to change settings. 119 1201.1 Process-Specific Subdirectories 121----------------------------------- 122 123The directory /proc contains (among other things) one subdirectory for each 124process running on the system, which is named after the process ID (PID). 125 | 1.. SPDX-License-Identifier: GPL-2.0 2 3==================== 4The /proc Filesystem 5==================== 6 7===================== ======================================= ================ 8/proc/sys Terrehon Bowden <terrehon@pacbell.net>, October 7 1999 --- 109 unchanged lines hidden (view full) --- 118show you how you can use /proc/sys to change settings. 119 1201.1 Process-Specific Subdirectories 121----------------------------------- 122 123The directory /proc contains (among other things) one subdirectory for each 124process running on the system, which is named after the process ID (PID). 125 |
126The link self points to the process reading the file system. Each process | 126The link 'self' points to the process reading the file system. Each process |
127subdirectory has the entries listed in Table 1-1. 128 | 127subdirectory has the entries listed in Table 1-1. 128 |
129Note that an open a file descriptor to /proc/<pid> or to any of its | 129Note that an open file descriptor to /proc/<pid> or to any of its |
130contained files or subdirectories does not prevent <pid> being reused 131for some other process in the event that <pid> exits. Operations on 132open /proc/<pid> file descriptors corresponding to dead processes 133never act on any new process that the kernel may, through chance, have 134also assigned the process ID <pid>. Instead, operations on these FDs 135usually fail with ESRCH. 136 137.. table:: Table 1-1: Process specific entries in /proc --- 77 unchanged lines hidden (view full) --- 215 216This shows you nearly the same information you would get if you viewed it with 217the ps command. In fact, ps uses the proc file system to obtain its 218information. But you get a more detailed view of the process by reading the 219file /proc/PID/status. It fields are described in table 1-2. 220 221The statm file contains more detailed information about the process 222memory usage. Its seven fields are explained in Table 1-3. The stat file | 130contained files or subdirectories does not prevent <pid> being reused 131for some other process in the event that <pid> exits. Operations on 132open /proc/<pid> file descriptors corresponding to dead processes 133never act on any new process that the kernel may, through chance, have 134also assigned the process ID <pid>. Instead, operations on these FDs 135usually fail with ESRCH. 136 137.. table:: Table 1-1: Process specific entries in /proc --- 77 unchanged lines hidden (view full) --- 215 216This shows you nearly the same information you would get if you viewed it with 217the ps command. In fact, ps uses the proc file system to obtain its 218information. But you get a more detailed view of the process by reading the 219file /proc/PID/status. It fields are described in table 1-2. 220 221The statm file contains more detailed information about the process 222memory usage. Its seven fields are explained in Table 1-3. The stat file |
223contains details information about the process itself. Its fields are | 223contains detailed information about the process itself. Its fields are |
224explained in Table 1-4. 225 226(for SMP CONFIG users) 227 228For making accounting scalable, RSS related information are handled in an 229asynchronous manner and the value may not be very precise. To see a precise 230snapshot of a moment, you can see /proc/<pid>/smaps file and scan page table. 231It's slow but very precise. --- 308 unchanged lines hidden (view full) --- 540 ht area uses huge tlb pages 541 ar architecture specific flag 542 dd do not include area into core dump 543 sd soft dirty flag 544 mm mixed map area 545 hg huge page advise flag 546 nh no huge page advise flag 547 mg mergable advise flag | 224explained in Table 1-4. 225 226(for SMP CONFIG users) 227 228For making accounting scalable, RSS related information are handled in an 229asynchronous manner and the value may not be very precise. To see a precise 230snapshot of a moment, you can see /proc/<pid>/smaps file and scan page table. 231It's slow but very precise. --- 308 unchanged lines hidden (view full) --- 540 ht area uses huge tlb pages 541 ar architecture specific flag 542 dd do not include area into core dump 543 sd soft dirty flag 544 mm mixed map area 545 hg huge page advise flag 546 nh no huge page advise flag 547 mg mergable advise flag |
548 bt - arm64 BTI guarded page | 548 bt arm64 BTI guarded page |
549 == ======================================= 550 551Note that there is no guarantee that every flag and associated mnemonic will 552be present in all further kernel releases. Things get changed, the flags may 553be vanished or the reverse -- new added. Interpretation of their meaning 554might change in future as well. So each consumer of these flags has to 555follow each specific kernel version for the exact semantic. 556 --- 220 unchanged lines hidden (view full) --- 777 778SPU 779 a spurious interrupt is some interrupt that was raised then lowered 780 by some IO device before it could be fully processed by the APIC. Hence 781 the APIC sees the interrupt but does not know what device it came from. 782 For this case the APIC will generate the interrupt with a IRQ vector 783 of 0xff. This might also be generated by chipset bugs. 784 | 549 == ======================================= 550 551Note that there is no guarantee that every flag and associated mnemonic will 552be present in all further kernel releases. Things get changed, the flags may 553be vanished or the reverse -- new added. Interpretation of their meaning 554might change in future as well. So each consumer of these flags has to 555follow each specific kernel version for the exact semantic. 556 --- 220 unchanged lines hidden (view full) --- 777 778SPU 779 a spurious interrupt is some interrupt that was raised then lowered 780 by some IO device before it could be fully processed by the APIC. Hence 781 the APIC sees the interrupt but does not know what device it came from. 782 For this case the APIC will generate the interrupt with a IRQ vector 783 of 0xff. This might also be generated by chipset bugs. 784 |
785RES, CAL, TLB] | 785RES, CAL, TLB |
786 rescheduling, call and TLB flush interrupts are 787 sent from one CPU to another per the needs of the OS. Typically, 788 their statistics are used by kernel developers and interested users to 789 determine the occurrence of interrupts of the given type. 790 791The above IRQ vectors are displayed only when relevant. For example, 792the threshold vector does not exist on x86_64 platforms. Others are 793suppressed when the system is a uniprocessor. As of this writing, only 794i386 and x86_64 platforms support the new IRQ vector displays. 795 796Of some interest is the introduction of the /proc/irq directory to 2.4. | 786 rescheduling, call and TLB flush interrupts are 787 sent from one CPU to another per the needs of the OS. Typically, 788 their statistics are used by kernel developers and interested users to 789 determine the occurrence of interrupts of the given type. 790 791The above IRQ vectors are displayed only when relevant. For example, 792the threshold vector does not exist on x86_64 platforms. Others are 793suppressed when the system is a uniprocessor. As of this writing, only 794i386 and x86_64 platforms support the new IRQ vector displays. 795 796Of some interest is the introduction of the /proc/irq directory to 2.4. |
797It could be used to set IRQ to CPU affinity, this means that you can "hook" an | 797It could be used to set IRQ to CPU affinity. This means that you can "hook" an |
798IRQ to only one CPU, or to exclude a CPU of handling IRQs. The contents of the 799irq subdir is one subdir for each IRQ, and two files; default_smp_affinity and 800prof_cpu_mask. 801 802For example:: 803 804 > ls /proc/irq/ 805 0 10 12 14 16 18 2 4 6 8 prof_cpu_mask 806 1 11 13 15 17 19 3 5 7 9 default_smp_affinity 807 > ls /proc/irq/0/ 808 smp_affinity 809 810smp_affinity is a bitmask, in which you can specify which CPUs can handle the | 798IRQ to only one CPU, or to exclude a CPU of handling IRQs. The contents of the 799irq subdir is one subdir for each IRQ, and two files; default_smp_affinity and 800prof_cpu_mask. 801 802For example:: 803 804 > ls /proc/irq/ 805 0 10 12 14 16 18 2 4 6 8 prof_cpu_mask 806 1 11 13 15 17 19 3 5 7 9 default_smp_affinity 807 > ls /proc/irq/0/ 808 smp_affinity 809 810smp_affinity is a bitmask, in which you can specify which CPUs can handle the |
811IRQ, you can set it by doing:: | 811IRQ. You can set it by doing:: |
812 813 > echo 1 > /proc/irq/10/smp_affinity 814 815This means that only the first CPU will handle the IRQ, but you can also echo 8165 which means that only the first and third CPU can handle the IRQ. 817 818The contents of each smp_affinity file is the same by default:: 819 820 > cat /proc/irq/0/smp_affinity 821 ffffffff 822 823There is an alternate interface, smp_affinity_list which allows specifying | 812 813 > echo 1 > /proc/irq/10/smp_affinity 814 815This means that only the first CPU will handle the IRQ, but you can also echo 8165 which means that only the first and third CPU can handle the IRQ. 817 818The contents of each smp_affinity file is the same by default:: 819 820 > cat /proc/irq/0/smp_affinity 821 ffffffff 822 823There is an alternate interface, smp_affinity_list which allows specifying |
824a cpu range instead of a bitmask:: | 824a CPU range instead of a bitmask:: |
825 826 > cat /proc/irq/0/smp_affinity_list 827 1024-1031 828 829The default_smp_affinity mask applies to all non-active IRQs, which are the 830IRQs which have not yet been allocated/activated, and hence which lack a 831/proc/irq/[0-9]* directory. 832 833The node file on an SMP system shows the node to which the device using the IRQ 834reports itself as being attached. This hardware locality information does not 835include information about any possible driver locality preference. 836 837prof_cpu_mask specifies which CPUs are to be profiled by the system wide | 825 826 > cat /proc/irq/0/smp_affinity_list 827 1024-1031 828 829The default_smp_affinity mask applies to all non-active IRQs, which are the 830IRQs which have not yet been allocated/activated, and hence which lack a 831/proc/irq/[0-9]* directory. 832 833The node file on an SMP system shows the node to which the device using the IRQ 834reports itself as being attached. This hardware locality information does not 835include information about any possible driver locality preference. 836 837prof_cpu_mask specifies which CPUs are to be profiled by the system wide |
838profiler. Default value is ffffffff (all cpus if there are only 32 of them). | 838profiler. Default value is ffffffff (all CPUs if there are only 32 of them). |
839 840The way IRQs are routed is handled by the IO-APIC, and it's Round Robin 841between all the CPUs which are allowed to handle it. As usual the kernel has 842more info than you and does a better job than you, so the defaults are the 843best choice for almost everyone. [Note this applies only to those IO-APIC's 844that support "Round Robin" interrupt distribution.] 845 846There are three more important subdirectories in /proc: net, scsi, and sys. --- 45 unchanged lines hidden (view full) --- 892 Node 0, zone DMA32, type Isolate 0 0 0 0 0 0 0 0 0 0 0 893 894 Number of blocks type Unmovable Reclaimable Movable Reserve Isolate 895 Node 0, zone DMA 2 0 5 1 0 896 Node 0, zone DMA32 41 6 967 2 0 897 898Fragmentation avoidance in the kernel works by grouping pages of different 899migrate types into the same contiguous regions of memory called page blocks. | 839 840The way IRQs are routed is handled by the IO-APIC, and it's Round Robin 841between all the CPUs which are allowed to handle it. As usual the kernel has 842more info than you and does a better job than you, so the defaults are the 843best choice for almost everyone. [Note this applies only to those IO-APIC's 844that support "Round Robin" interrupt distribution.] 845 846There are three more important subdirectories in /proc: net, scsi, and sys. --- 45 unchanged lines hidden (view full) --- 892 Node 0, zone DMA32, type Isolate 0 0 0 0 0 0 0 0 0 0 0 893 894 Number of blocks type Unmovable Reclaimable Movable Reserve Isolate 895 Node 0, zone DMA 2 0 5 1 0 896 Node 0, zone DMA32 41 6 967 2 0 897 898Fragmentation avoidance in the kernel works by grouping pages of different 899migrate types into the same contiguous regions of memory called page blocks. |
900A page block is typically the size of the default hugepage size e.g. 2MB on | 900A page block is typically the size of the default hugepage size, e.g. 2MB on |
901X86-64. By keeping pages grouped based on their ability to move, the kernel 902can reclaim pages within a page block to satisfy a high-order allocation. 903 904The pagetypinfo begins with information on the size of a page block. It 905then gives the same type of information as buddyinfo except broken down 906by migrate-type and finishes with details on how many page blocks of each 907type exist. 908 --- 51 unchanged lines hidden (view full) --- 960 VmallocChunk: 111088 kB 961 Percpu: 62080 kB 962 HardwareCorrupted: 0 kB 963 AnonHugePages: 49152 kB 964 ShmemHugePages: 0 kB 965 ShmemPmdMapped: 0 kB 966 967MemTotal | 901X86-64. By keeping pages grouped based on their ability to move, the kernel 902can reclaim pages within a page block to satisfy a high-order allocation. 903 904The pagetypinfo begins with information on the size of a page block. It 905then gives the same type of information as buddyinfo except broken down 906by migrate-type and finishes with details on how many page blocks of each 907type exist. 908 --- 51 unchanged lines hidden (view full) --- 960 VmallocChunk: 111088 kB 961 Percpu: 62080 kB 962 HardwareCorrupted: 0 kB 963 AnonHugePages: 49152 kB 964 ShmemHugePages: 0 kB 965 ShmemPmdMapped: 0 kB 966 967MemTotal |
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 bits and the kernel binary code) 970MemFree 971 The sum of LowFree+HighFree 972MemAvailable 973 An estimate of how much memory is available for starting new 974 applications, without swapping. Calculated from MemFree, 975 SReclaimable, the size of the file LRU lists, and the low 976 watermarks in each zone. --- 14 unchanged lines hidden (view full) --- 991 in the swapfile. This saves I/O) 992Active 993 Memory that has been used more recently and usually not 994 reclaimed unless absolutely necessary. 995Inactive 996 Memory which has been less recently used. It is more 997 eligible to be reclaimed for other purposes 998HighTotal, HighFree | 969 bits and the kernel binary code) 970MemFree 971 The sum of LowFree+HighFree 972MemAvailable 973 An estimate of how much memory is available for starting new 974 applications, without swapping. Calculated from MemFree, 975 SReclaimable, the size of the file LRU lists, and the low 976 watermarks in each zone. --- 14 unchanged lines hidden (view full) --- 991 in the swapfile. This saves I/O) 992Active 993 Memory that has been used more recently and usually not 994 reclaimed unless absolutely necessary. 995Inactive 996 Memory which has been less recently used. It is more 997 eligible to be reclaimed for other purposes 998HighTotal, HighFree |
999 Highmem is all memory above ~860MB of physical memory | 999 Highmem is all memory above ~860MB of physical memory. |
1000 Highmem areas are for use by userspace programs, or 1001 for the pagecache. The kernel must use tricks to access 1002 this memory, making it slower to access than lowmem. 1003LowTotal, LowFree 1004 Lowmem is memory which can be used for everything that 1005 highmem can be used for, but it is also available for the 1006 kernel's use for its own data structures. Among many 1007 other things, it is where everything from the Slab is --- 65 unchanged lines hidden (view full) --- 1073 The amount of memory presently allocated on the system. 1074 The committed memory is a sum of all of the memory which 1075 has been allocated by processes, even if it has not been 1076 "used" by them as of yet. A process which malloc()'s 1G 1077 of memory, but only touches 300M of it will show up as 1078 using 1G. This 1G is memory which has been "committed" to 1079 by the VM and can be used at any time by the allocating 1080 application. With strict overcommit enabled on the system | 1000 Highmem areas are for use by userspace programs, or 1001 for the pagecache. The kernel must use tricks to access 1002 this memory, making it slower to access than lowmem. 1003LowTotal, LowFree 1004 Lowmem is memory which can be used for everything that 1005 highmem can be used for, but it is also available for the 1006 kernel's use for its own data structures. Among many 1007 other things, it is where everything from the Slab is --- 65 unchanged lines hidden (view full) --- 1073 The amount of memory presently allocated on the system. 1074 The committed memory is a sum of all of the memory which 1075 has been allocated by processes, even if it has not been 1076 "used" by them as of yet. A process which malloc()'s 1G 1077 of memory, but only touches 300M of it will show up as 1078 using 1G. This 1G is memory which has been "committed" to 1079 by the VM and can be used at any time by the allocating 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 exceed the CommitLimit (detailed above) will not be permitted. 1083 This is useful if one needs to guarantee that processes will 1084 not fail due to lack of memory once that memory has been 1085 successfully allocated. 1086VmallocTotal 1087 total size of vmalloc memory area 1088VmallocUsed 1089 amount of vmalloc area which is used --- 4 unchanged lines hidden (view full) --- 1094 allocations. This stat excludes the cost of metadata. 1095 1096vmallocinfo 1097~~~~~~~~~~~ 1098 1099Provides information about vmalloced/vmaped areas. One line per area, 1100containing the virtual address range of the area, size in bytes, 1101caller information of the creator, and optional information depending | 1082 exceed the CommitLimit (detailed above) will not be permitted. 1083 This is useful if one needs to guarantee that processes will 1084 not fail due to lack of memory once that memory has been 1085 successfully allocated. 1086VmallocTotal 1087 total size of vmalloc memory area 1088VmallocUsed 1089 amount of vmalloc area which is used --- 4 unchanged lines hidden (view full) --- 1094 allocations. This stat excludes the cost of metadata. 1095 1096vmallocinfo 1097~~~~~~~~~~~ 1098 1099Provides information about vmalloced/vmaped areas. One line per area, 1100containing the virtual address range of the area, size in bytes, 1101caller information of the creator, and optional information depending |
1102on the kind of area : | 1102on the kind of area: |
1103 1104 ========== =================================================== 1105 pages=nr number of pages 1106 phys=addr if a physical address was specified 1107 ioremap I/O mapping (ioremap() and friends) 1108 vmalloc vmalloc() area 1109 vmap vmap()ed pages 1110 user VM_USERMAP area --- 28 unchanged lines hidden (view full) --- 1139 pages=2 vmalloc N1=2 1140 0xffffffffa0017000-0xffffffffa0022000 45056 sys_init_module+0xc27/0x1d00 ... 1141 pages=10 vmalloc N0=10 1142 1143 1144softirqs 1145~~~~~~~~ 1146 | 1103 1104 ========== =================================================== 1105 pages=nr number of pages 1106 phys=addr if a physical address was specified 1107 ioremap I/O mapping (ioremap() and friends) 1108 vmalloc vmalloc() area 1109 vmap vmap()ed pages 1110 user VM_USERMAP area --- 28 unchanged lines hidden (view full) --- 1139 pages=2 vmalloc N1=2 1140 0xffffffffa0017000-0xffffffffa0022000 45056 sys_init_module+0xc27/0x1d00 ... 1141 pages=10 vmalloc N0=10 1142 1143 1144softirqs 1145~~~~~~~~ 1146 |
1147Provides counts of softirq handlers serviced since boot time, for each cpu. | 1147Provides counts of softirq handlers serviced since boot time, for each CPU. |
1148 1149:: 1150 1151 > cat /proc/softirqs | 1148 1149:: 1150 1151 > cat /proc/softirqs |
1152 CPU0 CPU1 CPU2 CPU3 | 1152 CPU0 CPU1 CPU2 CPU3 |
1153 HI: 0 0 0 0 | 1153 HI: 0 0 0 0 |
1154 TIMER: 27166 27120 27097 27034 | 1154 TIMER: 27166 27120 27097 27034 |
1155 NET_TX: 0 0 0 17 1156 NET_RX: 42 0 0 39 | 1155 NET_TX: 0 0 0 17 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 1163 11641.3 IDE devices in /proc/ide 1165---------------------------- 1166 1167The subdirectory /proc/ide contains information about all IDE devices of which 1168the kernel is aware. There is one subdirectory for each IDE controller, the 1169file drivers and a link for each IDE device, pointing to the device directory 1170in the controller specific subtree. 1171 | 1162 1163 11641.3 IDE devices in /proc/ide 1165---------------------------- 1166 1167The subdirectory /proc/ide contains information about all IDE devices of which 1168the kernel is aware. There is one subdirectory for each IDE controller, the 1169file drivers and a link for each IDE device, pointing to the device directory 1170in the controller specific subtree. 1171 |
1172The file drivers contains general information about the drivers used for the | 1172The file 'drivers' contains general information about the drivers used for the |
1173IDE devices:: 1174 1175 > cat /proc/ide/drivers 1176 ide-cdrom version 4.53 1177 ide-disk version 1.08 1178 1179More detailed information can be found in the controller specific 1180subdirectories. These are named ide0, ide1 and so on. Each of these --- 223 unchanged lines hidden (view full) --- 1404 file to allow you to alter it by writing a new value in (IRQ 1405 number or none). 1406 ========= ==================================================================== 1407 14081.7 TTY info in /proc/tty 1409------------------------- 1410 1411Information about the available and actually used tty's can be found in the | 1173IDE devices:: 1174 1175 > cat /proc/ide/drivers 1176 ide-cdrom version 4.53 1177 ide-disk version 1.08 1178 1179More detailed information can be found in the controller specific 1180subdirectories. These are named ide0, ide1 and so on. Each of these --- 223 unchanged lines hidden (view full) --- 1404 file to allow you to alter it by writing a new value in (IRQ 1405 number or none). 1406 ========= ==================================================================== 1407 14081.7 TTY info in /proc/tty 1409------------------------- 1410 1411Information about the available and actually used tty's can be found in the |
1412directory /proc/tty.You'll find entries for drivers and line disciplines in | 1412directory /proc/tty. You'll find entries for drivers and line disciplines in |
1413this directory, as shown in Table 1-11. 1414 1415 1416.. table:: Table 1-11: Files in /proc/tty 1417 1418 ============= ============================================== 1419 File Content 1420 ============= ============================================== --- 45 unchanged lines hidden (view full) --- 1466 1467- user: normal processes executing in user mode 1468- nice: niced processes executing in user mode 1469- system: processes executing in kernel mode 1470- idle: twiddling thumbs 1471- iowait: In a word, iowait stands for waiting for I/O to complete. But there 1472 are several problems: 1473 | 1413this directory, as shown in Table 1-11. 1414 1415 1416.. table:: Table 1-11: Files in /proc/tty 1417 1418 ============= ============================================== 1419 File Content 1420 ============= ============================================== --- 45 unchanged lines hidden (view full) --- 1466 1467- user: normal processes executing in user mode 1468- nice: niced processes executing in user mode 1469- system: processes executing in kernel mode 1470- idle: twiddling thumbs 1471- iowait: In a word, iowait stands for waiting for I/O to complete. But there 1472 are several problems: 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 2. In a multi-core CPU, the task waiting for I/O to complete is not running 1478 on any CPU, so the iowait of each CPU is difficult to calculate. 1479 3. The value of iowait field in /proc/stat will decrease in certain 1480 conditions. 1481 1482 So, the iowait is not reliable by reading from /proc/stat. 1483- irq: servicing interrupts 1484- softirq: servicing softirqs --- 39 unchanged lines hidden (view full) --- 1524 1525.. table:: Table 1-12: Files in /proc/fs/ext4/<devname> 1526 1527 ============== ========================================================== 1528 File Content 1529 mb_groups details of multiblock allocator buddy cache of free blocks 1530 ============== ========================================================== 1531 | 1477 2. In a multi-core CPU, the task waiting for I/O to complete is not running 1478 on any CPU, so the iowait of each CPU is difficult to calculate. 1479 3. The value of iowait field in /proc/stat will decrease in certain 1480 conditions. 1481 1482 So, the iowait is not reliable by reading from /proc/stat. 1483- irq: servicing interrupts 1484- softirq: servicing softirqs --- 39 unchanged lines hidden (view full) --- 1524 1525.. table:: Table 1-12: Files in /proc/fs/ext4/<devname> 1526 1527 ============== ========================================================== 1528 File Content 1529 mb_groups details of multiblock allocator buddy cache of free blocks 1530 ============== ========================================================== 1531 |
15322.0 /proc/consoles 1533------------------ | 15321.10 /proc/consoles 1533------------------- |
1534Shows registered system console lines. 1535 1536To see which character device lines are currently used for the system console 1537/dev/console, you may simply look into the file /proc/consoles:: 1538 1539 > cat /proc/consoles 1540 tty0 -WU (ECp) 4:7 1541 ttyS0 -W- (Ep) 4:64 --- 43 unchanged lines hidden (view full) --- 1585A very interesting part of /proc is the directory /proc/sys. This is not only 1586a source of information, it also allows you to change parameters within the 1587kernel. Be very careful when attempting this. You can optimize your system, 1588but you can also cause it to crash. Never alter kernel parameters on a 1589production system. Set up a development machine and test to make sure that 1590everything works the way you want it to. You may have no alternative but to 1591reboot the machine once an error has been made. 1592 | 1534Shows registered system console lines. 1535 1536To see which character device lines are currently used for the system console 1537/dev/console, you may simply look into the file /proc/consoles:: 1538 1539 > cat /proc/consoles 1540 tty0 -WU (ECp) 4:7 1541 ttyS0 -W- (Ep) 4:64 --- 43 unchanged lines hidden (view full) --- 1585A very interesting part of /proc is the directory /proc/sys. This is not only 1586a source of information, it also allows you to change parameters within the 1587kernel. Be very careful when attempting this. You can optimize your system, 1588but you can also cause it to crash. Never alter kernel parameters on a 1589production system. Set up a development machine and test to make sure that 1590everything works the way you want it to. You may have no alternative but to 1591reboot the machine once an error has been made. 1592 |
1593To change a value, simply echo the new value into the file. An example is 1594given below in the section on the file system data. You need to be root to do 1595this. You can create your own boot script to perform this every time your 1596system boots. | 1593To change a value, simply echo the new value into the file. 1594You need to be root to do this. You can create your own boot script 1595to perform this every time your system boots. |
1597 1598The files in /proc/sys can be used to fine tune and monitor miscellaneous and 1599general things in the operation of the Linux kernel. Since some of the files 1600can inadvertently disrupt your system, it is advisable to read both 1601documentation and source before actually making adjustments. In any case, be 1602very careful when writing to any of these files. The entries in /proc may 1603change slightly between the 2.1.* and the 2.2 kernel, so if there is any doubt 1604review the kernel documentation in the directory /usr/src/linux/Documentation. --- 14 unchanged lines hidden (view full) --- 1619 1620 1621Chapter 3: Per-process Parameters 1622================================= 1623 16243.1 /proc/<pid>/oom_adj & /proc/<pid>/oom_score_adj- Adjust the oom-killer score 1625-------------------------------------------------------------------------------- 1626 | 1596 1597The files in /proc/sys can be used to fine tune and monitor miscellaneous and 1598general things in the operation of the Linux kernel. Since some of the files 1599can inadvertently disrupt your system, it is advisable to read both 1600documentation and source before actually making adjustments. In any case, be 1601very careful when writing to any of these files. The entries in /proc may 1602change slightly between the 2.1.* and the 2.2 kernel, so if there is any doubt 1603review the kernel documentation in the directory /usr/src/linux/Documentation. --- 14 unchanged lines hidden (view full) --- 1618 1619 1620Chapter 3: Per-process Parameters 1621================================= 1622 16233.1 /proc/<pid>/oom_adj & /proc/<pid>/oom_score_adj- Adjust the oom-killer score 1624-------------------------------------------------------------------------------- 1625 |
1627These file can be used to adjust the badness heuristic used to select which 1628process gets killed in out of memory conditions. | 1626These files can be used to adjust the badness heuristic used to select which 1627process gets killed in out of memory (oom) conditions. |
1629 1630The badness heuristic assigns a value to each candidate task ranging from 0 1631(never kill) to 1000 (always kill) to determine which process is targeted. The 1632units are roughly a proportion along that range of allowed memory the process 1633may allocate from based on an estimation of its current memory and swap use. 1634For example, if a task is using all allowed memory, its badness score will be 16351000. If it is using half of its allowed memory, its score will be 500. 1636 --- 39 unchanged lines hidden (view full) --- 1676generation children with separate address spaces instead, if possible. This 1677avoids servers and important system daemons from being killed and loses the 1678minimal amount of work. 1679 1680 16813.2 /proc/<pid>/oom_score - Display current oom-killer score 1682------------------------------------------------------------- 1683 | 1628 1629The badness heuristic assigns a value to each candidate task ranging from 0 1630(never kill) to 1000 (always kill) to determine which process is targeted. The 1631units are roughly a proportion along that range of allowed memory the process 1632may allocate from based on an estimation of its current memory and swap use. 1633For example, if a task is using all allowed memory, its badness score will be 16341000. If it is using half of its allowed memory, its score will be 500. 1635 --- 39 unchanged lines hidden (view full) --- 1675generation children with separate address spaces instead, if possible. This 1676avoids servers and important system daemons from being killed and loses the 1677minimal amount of work. 1678 1679 16803.2 /proc/<pid>/oom_score - Display current oom-killer score 1681------------------------------------------------------------- 1682 |
1684This file can be used to check the current score used by the oom-killer is for | 1683This file can be used to check the current score used by the oom-killer for |
1685any given <pid>. Use it together with /proc/<pid>/oom_score_adj to tune which 1686process should be killed in an out-of-memory situation. 1687 1688 16893.3 /proc/<pid>/io - Display the IO accounting fields 1690------------------------------------------------------- 1691 | 1684any given <pid>. Use it together with /proc/<pid>/oom_score_adj to tune which 1685process should be killed in an out-of-memory situation. 1686 1687 16883.3 /proc/<pid>/io - Display the IO accounting fields 1689------------------------------------------------------- 1690 |
1692This file contains IO statistics for each running process | 1691This file contains IO statistics for each running process. |
1693 1694Example 1695~~~~~~~ 1696 1697:: 1698 1699 test:/tmp # dd if=/dev/zero of=/tmp/test.dat & 1700 [1] 3828 --- 14 unchanged lines hidden (view full) --- 1715rchar 1716^^^^^ 1717 1718I/O counter: chars read 1719The number of bytes which this task has caused to be read from storage. This 1720is simply the sum of bytes which this process passed to read() and pread(). 1721It includes things like tty IO and it is unaffected by whether or not actual 1722physical disk IO was required (the read might have been satisfied from | 1692 1693Example 1694~~~~~~~ 1695 1696:: 1697 1698 test:/tmp # dd if=/dev/zero of=/tmp/test.dat & 1699 [1] 3828 --- 14 unchanged lines hidden (view full) --- 1714rchar 1715^^^^^ 1716 1717I/O counter: chars read 1718The number of bytes which this task has caused to be read from storage. This 1719is simply the sum of bytes which this process passed to read() and pread(). 1720It includes things like tty IO and it is unaffected by whether or not actual 1721physical disk IO was required (the read might have been satisfied from |
1723pagecache) | 1722pagecache). |
1724 1725 1726wchar 1727^^^^^ 1728 1729I/O counter: chars written 1730The number of bytes which this task has caused, or shall cause to be written 1731to disk. Similar caveats apply here as with rchar. --- 141 unchanged lines hidden (view full) --- 1873 1874For more information on mount propagation see: 1875 1876 Documentation/filesystems/sharedsubtree.rst 1877 1878 18793.6 /proc/<pid>/comm & /proc/<pid>/task/<tid>/comm 1880-------------------------------------------------------- | 1723 1724 1725wchar 1726^^^^^ 1727 1728I/O counter: chars written 1729The number of bytes which this task has caused, or shall cause to be written 1730to disk. Similar caveats apply here as with rchar. --- 141 unchanged lines hidden (view full) --- 1872 1873For more information on mount propagation see: 1874 1875 Documentation/filesystems/sharedsubtree.rst 1876 1877 18783.6 /proc/<pid>/comm & /proc/<pid>/task/<tid>/comm 1879-------------------------------------------------------- |
1881These files provide a method to access a tasks comm value. It also allows for | 1880These files provide a method to access a task's comm value. It also allows for |
1882a task to set its own or one of its thread siblings comm value. The comm value 1883is limited in size compared to the cmdline value, so writing anything longer 1884then the kernel's TASK_COMM_LEN (currently 16 chars) will result in a truncated 1885comm value. 1886 1887 18883.7 /proc/<pid>/task/<tid>/children - Information about task children 1889------------------------------------------------------------------------- 1890This file provides a fast way to retrieve first level children pids 1891of a task pointed by <pid>/<tid> pair. The format is a space separated 1892stream of pids. 1893 | 1881a task to set its own or one of its thread siblings comm value. The comm value 1882is limited in size compared to the cmdline value, so writing anything longer 1883then the kernel's TASK_COMM_LEN (currently 16 chars) will result in a truncated 1884comm value. 1885 1886 18873.7 /proc/<pid>/task/<tid>/children - Information about task children 1888------------------------------------------------------------------------- 1889This file provides a fast way to retrieve first level children pids 1890of a task pointed by <pid>/<tid> pair. The format is a space separated 1891stream of pids. 1892 |
1894Note the "first level" here -- if a child has own children they will 1895not be listed here, one needs to read /proc/<children-pid>/task/<tid>/children | 1893Note the "first level" here -- if a child has its own children they will 1894not be listed here; one needs to read /proc/<children-pid>/task/<tid>/children |
1896to obtain the descendants. 1897 1898Since this interface is intended to be fast and cheap it doesn't 1899guarantee to provide precise results and some children might be 1900skipped, especially if they've exited right after we printed their | 1895to obtain the descendants. 1896 1897Since this interface is intended to be fast and cheap it doesn't 1898guarantee to provide precise results and some children might be 1899skipped, especially if they've exited right after we printed their |
1901pids, so one need to either stop or freeze processes being inspected | 1900pids, so one needs to either stop or freeze processes being inspected |
1902if precise results are needed. 1903 1904 19053.8 /proc/<pid>/fdinfo/<fd> - Information about opened file 1906--------------------------------------------------------------- 1907This file provides information associated with an opened file. The regular | 1901if precise results are needed. 1902 1903 19043.8 /proc/<pid>/fdinfo/<fd> - Information about opened file 1905--------------------------------------------------------------- 1906This file provides information associated with an opened file. The regular |
1908files have at least three fields -- 'pos', 'flags' and mnt_id. The 'pos' | 1907files have at least three fields -- 'pos', 'flags' and 'mnt_id'. The 'pos' |
1909represents the current offset of the opened file in decimal form [see lseek(2) 1910for details], 'flags' denotes the octal O_xxx mask the file has been 1911created with [see open(2) for details] and 'mnt_id' represents mount ID of 1912the file system containing the opened file [see 3.5 /proc/<pid>/mountinfo 1913for details]. 1914 1915A typical output is:: 1916 --- 54 unchanged lines hidden (view full) --- 1971Fsnotify files 1972~~~~~~~~~~~~~~ 1973For inotify files the format is the following:: 1974 1975 pos: 0 1976 flags: 02000000 1977 inotify wd:3 ino:9e7e sdev:800013 mask:800afce ignored_mask:0 fhandle-bytes:8 fhandle-type:1 f_handle:7e9e0000640d1b6d 1978 | 1908represents the current offset of the opened file in decimal form [see lseek(2) 1909for details], 'flags' denotes the octal O_xxx mask the file has been 1910created with [see open(2) for details] and 'mnt_id' represents mount ID of 1911the file system containing the opened file [see 3.5 /proc/<pid>/mountinfo 1912for details]. 1913 1914A typical output is:: 1915 --- 54 unchanged lines hidden (view full) --- 1970Fsnotify files 1971~~~~~~~~~~~~~~ 1972For inotify files the format is the following:: 1973 1974 pos: 0 1975 flags: 02000000 1976 inotify wd:3 ino:9e7e sdev:800013 mask:800afce ignored_mask:0 fhandle-bytes:8 fhandle-type:1 f_handle:7e9e0000640d1b6d 1977 |
1979where 'wd' is a watch descriptor in decimal form, ie a target file | 1978where 'wd' is a watch descriptor in decimal form, i.e. a target file |
1980descriptor number, 'ino' and 'sdev' are inode and device where the 1981target file resides and the 'mask' is the mask of events, all in hex 1982form [see inotify(7) for more details]. 1983 1984If the kernel was built with exportfs support, the path to the target 1985file is encoded as a file handle. The file handle is provided by three 1986fields 'fhandle-bytes', 'fhandle-type' and 'f_handle', all in hex 1987format. --- 10 unchanged lines hidden (view full) --- 1998 mnt_id: 9 1999 fanotify flags:10 event-flags:0 2000 fanotify mnt_id:12 mflags:40 mask:38 ignored_mask:40000003 2001 fanotify ino:4f969 sdev:800013 mflags:0 mask:3b ignored_mask:40000000 fhandle-bytes:8 fhandle-type:1 f_handle:69f90400c275b5b4 2002 2003where fanotify 'flags' and 'event-flags' are values used in fanotify_init 2004call, 'mnt_id' is the mount point identifier, 'mflags' is the value of 2005flags associated with mark which are tracked separately from events | 1979descriptor number, 'ino' and 'sdev' are inode and device where the 1980target file resides and the 'mask' is the mask of events, all in hex 1981form [see inotify(7) for more details]. 1982 1983If the kernel was built with exportfs support, the path to the target 1984file is encoded as a file handle. The file handle is provided by three 1985fields 'fhandle-bytes', 'fhandle-type' and 'f_handle', all in hex 1986format. --- 10 unchanged lines hidden (view full) --- 1997 mnt_id: 9 1998 fanotify flags:10 event-flags:0 1999 fanotify mnt_id:12 mflags:40 mask:38 ignored_mask:40000003 2000 fanotify ino:4f969 sdev:800013 mflags:0 mask:3b ignored_mask:40000000 fhandle-bytes:8 fhandle-type:1 f_handle:69f90400c275b5b4 2001 2002where fanotify 'flags' and 'event-flags' are values used in fanotify_init 2003call, 'mnt_id' is the mount point identifier, 'mflags' is the value of 2004flags associated with mark which are tracked separately from events |
2006mask. 'ino', 'sdev' are target inode and device, 'mask' is the events | 2005mask. 'ino' and 'sdev' are target inode and device, 'mask' is the events |
2007mask and 'ignored_mask' is the mask of events which are to be ignored. | 2006mask and 'ignored_mask' is the mask of events which are to be ignored. |
2008All in hex format. Incorporation of 'mflags', 'mask' and 'ignored_mask' 2009does provide information about flags and mask used in fanotify_mark | 2007All are in hex format. Incorporation of 'mflags', 'mask' and 'ignored_mask' 2008provide information about flags and mask used in fanotify_mark |
2010call [see fsnotify manpage for details]. 2011 2012While the first three lines are mandatory and always printed, the rest is 2013optional and may be omitted if no marks created yet. 2014 2015Timerfd files 2016~~~~~~~~~~~~~ 2017 --- 6 unchanged lines hidden (view full) --- 2024 ticks: 0 2025 settime flags: 01 2026 it_value: (0, 49406829) 2027 it_interval: (1, 0) 2028 2029where 'clockid' is the clock type and 'ticks' is the number of the timer expirations 2030that have occurred [see timerfd_create(2) for details]. 'settime flags' are 2031flags in octal form been used to setup the timer [see timerfd_settime(2) for | 2009call [see fsnotify manpage for details]. 2010 2011While the first three lines are mandatory and always printed, the rest is 2012optional and may be omitted if no marks created yet. 2013 2014Timerfd files 2015~~~~~~~~~~~~~ 2016 --- 6 unchanged lines hidden (view full) --- 2023 ticks: 0 2024 settime flags: 01 2025 it_value: (0, 49406829) 2026 it_interval: (1, 0) 2027 2028where 'clockid' is the clock type and 'ticks' is the number of the timer expirations 2029that have occurred [see timerfd_create(2) for details]. 'settime flags' are 2030flags in octal form been used to setup the timer [see timerfd_settime(2) for |
2032details]. 'it_value' is remaining time until the timer exiration. | 2031details]. 'it_value' is remaining time until the timer expiration. |
2033'it_interval' is the interval for the timer. Note the timer might be set up 2034with TIMER_ABSTIME option which will be shown in 'settime flags', but 'it_value' 2035still exhibits timer's remaining time. 2036 20373.9 /proc/<pid>/map_files - Information about memory mapped files 2038--------------------------------------------------------------------- 2039This directory contains symbolic links which represent memory mapped files 2040the process is maintaining. Example output:: --- 13 unchanged lines hidden (view full) --- 2054/proc/<pid>/smaps, both of which contain many more records. At the same 2055time one can open(2) mappings from the listings of two processes and 2056comparing their inode numbers to figure out which anonymous memory areas 2057are actually shared. 2058 20593.10 /proc/<pid>/timerslack_ns - Task timerslack value 2060--------------------------------------------------------- 2061This file provides the value of the task's timerslack value in nanoseconds. | 2032'it_interval' is the interval for the timer. Note the timer might be set up 2033with TIMER_ABSTIME option which will be shown in 'settime flags', but 'it_value' 2034still exhibits timer's remaining time. 2035 20363.9 /proc/<pid>/map_files - Information about memory mapped files 2037--------------------------------------------------------------------- 2038This directory contains symbolic links which represent memory mapped files 2039the process is maintaining. Example output:: --- 13 unchanged lines hidden (view full) --- 2053/proc/<pid>/smaps, both of which contain many more records. At the same 2054time one can open(2) mappings from the listings of two processes and 2055comparing their inode numbers to figure out which anonymous memory areas 2056are actually shared. 2057 20583.10 /proc/<pid>/timerslack_ns - Task timerslack value 2059--------------------------------------------------------- 2060This file provides the value of the task's timerslack value in nanoseconds. |
2062This value specifies a amount of time that normal timers may be deferred | 2061This value specifies an amount of time that normal timers may be deferred |
2063in order to coalesce timers and avoid unnecessary wakeups. 2064 | 2062in order to coalesce timers and avoid unnecessary wakeups. 2063 |
2065This allows a task's interactivity vs power consumption trade off to be | 2064This allows a task's interactivity vs power consumption tradeoff to be |
2066adjusted. 2067 | 2065adjusted. 2066 |
2068Writing 0 to the file will set the tasks timerslack to the default value. | 2067Writing 0 to the file will set the task's timerslack to the default value. |
2069 2070Valid values are from 0 - ULLONG_MAX 2071 2072An application setting the value must have PTRACE_MODE_ATTACH_FSCREDS level 2073permissions on the task specified to change its timerslack_ns value. 2074 20753.11 /proc/<pid>/patch_state - Livepatch patch operation state 2076----------------------------------------------------------------- --- 23 unchanged lines hidden (view full) --- 2100:: 2101 2102 $ cat /proc/6753/arch_status 2103 AVX512_elapsed_ms: 8 2104 2105Description 2106~~~~~~~~~~~ 2107 | 2068 2069Valid values are from 0 - ULLONG_MAX 2070 2071An application setting the value must have PTRACE_MODE_ATTACH_FSCREDS level 2072permissions on the task specified to change its timerslack_ns value. 2073 20743.11 /proc/<pid>/patch_state - Livepatch patch operation state 2075----------------------------------------------------------------- --- 23 unchanged lines hidden (view full) --- 2099:: 2100 2101 $ cat /proc/6753/arch_status 2102 AVX512_elapsed_ms: 8 2103 2104Description 2105~~~~~~~~~~~ 2106 |
2108x86 specific entries: | 2107x86 specific entries |
2109~~~~~~~~~~~~~~~~~~~~~ 2110 | 2108~~~~~~~~~~~~~~~~~~~~~ 2109 |
2111AVX512_elapsed_ms: | 2110AVX512_elapsed_ms |
2112^^^^^^^^^^^^^^^^^^ 2113 2114 If AVX512 is supported on the machine, this entry shows the milliseconds 2115 elapsed since the last time AVX512 usage was recorded. The recording 2116 happens on a best effort basis when a task is scheduled out. This means 2117 that the value depends on two factors: 2118 2119 1) The time which the task spent on the CPU without being scheduled --- 9 unchanged lines hidden (view full) --- 2129 of the overall scenario on the system in order to determine whether a 2130 task is a real AVX512 user or not. Precise information can be obtained 2131 with performance counters. 2132 2133 A special value of '-1' indicates that no AVX512 usage was recorded, thus 2134 the task is unlikely an AVX512 user, but depends on the workload and the 2135 scheduling scenario, it also could be a false negative mentioned above. 2136 | 2111^^^^^^^^^^^^^^^^^^ 2112 2113 If AVX512 is supported on the machine, this entry shows the milliseconds 2114 elapsed since the last time AVX512 usage was recorded. The recording 2115 happens on a best effort basis when a task is scheduled out. This means 2116 that the value depends on two factors: 2117 2118 1) The time which the task spent on the CPU without being scheduled --- 9 unchanged lines hidden (view full) --- 2128 of the overall scenario on the system in order to determine whether a 2129 task is a real AVX512 user or not. Precise information can be obtained 2130 with performance counters. 2131 2132 A special value of '-1' indicates that no AVX512 usage was recorded, thus 2133 the task is unlikely an AVX512 user, but depends on the workload and the 2134 scheduling scenario, it also could be a false negative mentioned above. 2135 |
2137Configuring procfs 2138------------------ | 2136Chapter 4: Configuring procfs 2137============================= |
2139 21404.1 Mount options 2141--------------------- 2142 2143The following mount options are supported: 2144 2145 ========= ======================================================== 2146 hidepid= Set /proc/<pid>/ access mode. --- 26 unchanged lines hidden (view full) --- 2173 2174gid= defines a group authorized to learn processes information otherwise 2175prohibited by hidepid=. If you use some daemon like identd which needs to learn 2176information about processes information, just add identd to this group. 2177 2178subset=pid hides all top level files and directories in the procfs that 2179are not related to tasks. 2180 | 2138 21394.1 Mount options 2140--------------------- 2141 2142The following mount options are supported: 2143 2144 ========= ======================================================== 2145 hidepid= Set /proc/<pid>/ access mode. --- 26 unchanged lines hidden (view full) --- 2172 2173gid= defines a group authorized to learn processes information otherwise 2174prohibited by hidepid=. If you use some daemon like identd which needs to learn 2175information about processes information, just add identd to this group. 2176 2177subset=pid hides all top level files and directories in the procfs that 2178are not related to tasks. 2179 |
21815 Filesystem behavior 2182---------------------------- | 2180Chapter 5: Filesystem behavior 2181============================== |
2183 2184Originally, before the advent of pid namepsace, procfs was a global file 2185system. It means that there was only one procfs instance in the system. 2186 2187When pid namespace was added, a separate procfs instance was mounted in 2188each pid namespace. So, procfs mount options are global among all | 2182 2183Originally, before the advent of pid namepsace, procfs was a global file 2184system. It means that there was only one procfs instance in the system. 2185 2186When pid namespace was added, a separate procfs instance was mounted in 2187each pid namespace. So, procfs mount options are global among all |
2189mountpoints within the same namespace. | 2188mountpoints within the same namespace:: |
2190 | 2189 |
2191:: | 2190 # grep ^proc /proc/mounts 2191 proc /proc proc rw,relatime,hidepid=2 0 0 |
2192 | 2192 |
2193# grep ^proc /proc/mounts 2194proc /proc proc rw,relatime,hidepid=2 0 0 | 2193 # strace -e mount mount -o hidepid=1 -t proc proc /tmp/proc 2194 mount("proc", "/tmp/proc", "proc", 0, "hidepid=1") = 0 2195 +++ exited with 0 +++ |
2195 | 2196 |
2196# strace -e mount mount -o hidepid=1 -t proc proc /tmp/proc 2197mount("proc", "/tmp/proc", "proc", 0, "hidepid=1") = 0 2198+++ exited with 0 +++ | 2197 # grep ^proc /proc/mounts 2198 proc /proc proc rw,relatime,hidepid=2 0 0 2199 proc /tmp/proc proc rw,relatime,hidepid=2 0 0 |
2199 | 2200 |
2200# grep ^proc /proc/mounts 2201proc /proc proc rw,relatime,hidepid=2 0 0 2202proc /tmp/proc proc rw,relatime,hidepid=2 0 0 2203 | |
2204and only after remounting procfs mount options will change at all | 2201and only after remounting procfs mount options will change at all |
2205mountpoints. | 2202mountpoints:: |
2206 | 2203 |
2207# mount -o remount,hidepid=1 -t proc proc /tmp/proc | 2204 # mount -o remount,hidepid=1 -t proc proc /tmp/proc |
2208 | 2205 |
2209# grep ^proc /proc/mounts 2210proc /proc proc rw,relatime,hidepid=1 0 0 2211proc /tmp/proc proc rw,relatime,hidepid=1 0 0 | 2206 # grep ^proc /proc/mounts 2207 proc /proc proc rw,relatime,hidepid=1 0 0 2208 proc /tmp/proc proc rw,relatime,hidepid=1 0 0 |
2212 2213This behavior is different from the behavior of other filesystems. 2214 2215The new procfs behavior is more like other filesystems. Each procfs mount 2216creates a new procfs instance. Mount options affect own procfs instance. 2217It means that it became possible to have several procfs instances | 2209 2210This behavior is different from the behavior of other filesystems. 2211 2212The new procfs behavior is more like other filesystems. Each procfs mount 2213creates a new procfs instance. Mount options affect own procfs instance. 2214It means that it became possible to have several procfs instances |
2218displaying tasks with different filtering options in one pid namespace. | 2215displaying tasks with different filtering options in one pid namespace:: |
2219 | 2216 |
2220# mount -o hidepid=invisible -t proc proc /proc 2221# mount -o hidepid=noaccess -t proc proc /tmp/proc 2222# grep ^proc /proc/mounts 2223proc /proc proc rw,relatime,hidepid=invisible 0 0 2224proc /tmp/proc proc rw,relatime,hidepid=noaccess 0 0 | 2217 # mount -o hidepid=invisible -t proc proc /proc 2218 # mount -o hidepid=noaccess -t proc proc /tmp/proc 2219 # grep ^proc /proc/mounts 2220 proc /proc proc rw,relatime,hidepid=invisible 0 0 2221 proc /tmp/proc proc rw,relatime,hidepid=noaccess 0 0 |