Proc pid file system




















Related concepts Threads and processes System Architecture. Thread life cycle System Architecture. Pathname management System Architecture. Related reference InterruptWait. Parent topic : Processes. January 14, at EST.

Establish a file descriptor to a process. This work is based on the 2. It also only covers IPv4 networking, not IPv6 nor other protocols - sorry. But additions and patches are welcome and will be added to this document if you mail them to Bodo. Thanks to everybody else who contributed source or docs to the Linux kernel and helped create a great piece of software… :. If the above direction does not works for you, you could try the kernel mailing list at linux-kernel vger.

The proc file system acts as an interface to internal data structures in the kernel. It can be used to obtain information about the system and to change certain kernel parameters at runtime sysctl. Each process subdirectory has the entries listed in Table An extension based on maps, showing the memory consumption of each mapping and flags associated with it. Accumulated smaps stats for all mappings of the process. This can be derived from smaps, but is faster and more convenient.

An extension based on maps, showing the memory locality and binding policy as well as mem usage in pages of each mapping. This shows you nearly the same information you would get if you viewed it with the ps command.

In fact, ps uses the proc file system to obtain its information. It fields are described in table The statm file contains more detailed information about the process memory usage. Its seven fields are explained in Table The stat file contains detailed information about the process itself.

Its fields are explained in Table For making accounting scalable, RSS related information are handled in an asynchronous manner and the value may not be very precise. If the mapping is not associated with a file:. So if a process has pages all to itself, and shared with one other process, its PSS will be Please note that the printed value might be lower than the real value due to optimizations used in the current implementation.

If this is not desirable please file a bug report. It just shows the current status. This member represents the kernel flags associated with the particular virtual memory area in two letter encoded manner. The codes are the following:. Note that there is no guarantee that every flag and associated mnemonic will be present in all further kernel releases.

Things get changed, the flags may be vanished or the reverse — new added. Interpretation of their meaning might change in future as well. So each consumer of these flags has to follow each specific kernel version for the exact semantic.

This typically manifests when doing partial reads of these files while the memory map is being modified. Despite the races, we do provide the following guarantees:.

Additionally, it contains these fields:. They represent the proportional shares of anonymous, file, and shmem pages, as described for smaps above. These fields are omitted in smaps since each mapping identifies the type anon, file, or shmem of all pages it contains.

To clear the bits for all the pages associated with the process:. For detailed explanation, see Examining Process Page Tables. The output follows a general format where mapping details get summarized separated by blank spaces, one mapping per each file line:. Similar to the process entries, the kernel data files give information about the running kernel. Not all of these will be present in your system.

It depends on the kernel configuration and the loaded modules, which files are there, and which are missing. Example: 0. The new vectors are:. Only available on some systems. This interrupt may also be generated when the temperature drops back to normal. Hence the APIC sees the interrupt but does not know what device it came from. This might also be generated by chipset bugs. Typically, their statistics are used by kernel developers and interested users to determine the occurrence of interrupts of the given type.

The above IRQ vectors are displayed only when relevant. Others are suppressed when the system is a uniprocessor. You can set it by doing:. This hardware locality information does not include information about any possible driver locality preference. Default value is ffffffff all CPUs if there are only 32 of them. As usual the kernel has more info than you and does a better job than you, so the defaults are the best choice for almost everyone. The general rule is that the contents, or even the existence of these directories, depend on your kernel configuration.

If SCSI is not enabled, the directory scsi may not exist. The same is true with the net, which is there only when networking support is present in the running kernel.

The slabinfo file gives information about memory usage at the slab level. Linux uses slab pools for memory management above page level in version 2.

Commonly used objects have their own slab pool such as network buffers, directory cache, and so on. External fragmentation is a problem under some workloads, and buddyinfo is a useful tool for helping diagnose these problems. Buddyinfo will give you a clue as to how big an area you can safely allocate, or why a previous allocation failed.

Each column represents the number of pages of a certain order which are available. Fragmentation avoidance in the kernel works by grouping pages of different migrate types into the same contiguous regions of memory called page blocks.

A page block is typically the size of the default hugepage size, e. Is there a defined structure for getting each field of this file for a particular process instead of parsing the file? Here's an example:. This was in contrast to much older mechanisms like stat 2 which required binary structures like. Stack Overflow for Teams — Collaborate and share knowledge with a private group.

Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 6 years, 3 months ago. Active 6 years, 3 months ago. Viewed 20k times. Improve this question.



0コメント

  • 1000 / 1000