proc.txt 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230
  1. ------------------------------------------------------------------------------
  2. T H E /proc F I L E S Y S T E M
  3. ------------------------------------------------------------------------------
  4. /proc/sys Terrehon Bowden <terrehon@pacbell.net> October 7 1999
  5. Bodo Bauer <bb@ricochet.net>
  6. 2.4.x update Jorge Nerin <comandante@zaralinux.com> November 14 2000
  7. move /proc/sys Shen Feng <shen@cn.fujitsu.com> April 1 2009
  8. ------------------------------------------------------------------------------
  9. Version 1.3 Kernel version 2.2.12
  10. Kernel version 2.4.0-test11-pre4
  11. ------------------------------------------------------------------------------
  12. Table of Contents
  13. -----------------
  14. 0 Preface
  15. 0.1 Introduction/Credits
  16. 0.2 Legal Stuff
  17. 1 Collecting System Information
  18. 1.1 Process-Specific Subdirectories
  19. 1.2 Kernel data
  20. 1.3 IDE devices in /proc/ide
  21. 1.4 Networking info in /proc/net
  22. 1.5 SCSI info
  23. 1.6 Parallel port info in /proc/parport
  24. 1.7 TTY info in /proc/tty
  25. 1.8 Miscellaneous kernel statistics in /proc/stat
  26. 1.9 Ext4 file system parameters
  27. 2 Modifying System Parameters
  28. 3 Per-Process Parameters
  29. 3.1 /proc/<pid>/oom_adj - Adjust the oom-killer score
  30. 3.2 /proc/<pid>/oom_score - Display current oom-killer score
  31. 3.3 /proc/<pid>/io - Display the IO accounting fields
  32. 3.4 /proc/<pid>/coredump_filter - Core dump filtering settings
  33. 3.5 /proc/<pid>/mountinfo - Information about mounts
  34. ------------------------------------------------------------------------------
  35. Preface
  36. ------------------------------------------------------------------------------
  37. 0.1 Introduction/Credits
  38. ------------------------
  39. This documentation is part of a soon (or so we hope) to be released book on
  40. the SuSE Linux distribution. As there is no complete documentation for the
  41. /proc file system and we've used many freely available sources to write these
  42. chapters, it seems only fair to give the work back to the Linux community.
  43. This work is based on the 2.2.* kernel version and the upcoming 2.4.*. I'm
  44. afraid it's still far from complete, but we hope it will be useful. As far as
  45. we know, it is the first 'all-in-one' document about the /proc file system. It
  46. is focused on the Intel x86 hardware, so if you are looking for PPC, ARM,
  47. SPARC, AXP, etc., features, you probably won't find what you are looking for.
  48. It also only covers IPv4 networking, not IPv6 nor other protocols - sorry. But
  49. additions and patches are welcome and will be added to this document if you
  50. mail them to Bodo.
  51. We'd like to thank Alan Cox, Rik van Riel, and Alexey Kuznetsov and a lot of
  52. other people for help compiling this documentation. We'd also like to extend a
  53. special thank you to Andi Kleen for documentation, which we relied on heavily
  54. to create this document, as well as the additional information he provided.
  55. Thanks to everybody else who contributed source or docs to the Linux kernel
  56. and helped create a great piece of software... :)
  57. If you have any comments, corrections or additions, please don't hesitate to
  58. contact Bodo Bauer at bb@ricochet.net. We'll be happy to add them to this
  59. document.
  60. The latest version of this document is available online at
  61. http://skaro.nightcrawler.com/~bb/Docs/Proc as HTML version.
  62. If the above direction does not works for you, ypu could try the kernel
  63. mailing list at linux-kernel@vger.kernel.org and/or try to reach me at
  64. comandante@zaralinux.com.
  65. 0.2 Legal Stuff
  66. ---------------
  67. We don't guarantee the correctness of this document, and if you come to us
  68. complaining about how you screwed up your system because of incorrect
  69. documentation, we won't feel responsible...
  70. ------------------------------------------------------------------------------
  71. CHAPTER 1: COLLECTING SYSTEM INFORMATION
  72. ------------------------------------------------------------------------------
  73. ------------------------------------------------------------------------------
  74. In This Chapter
  75. ------------------------------------------------------------------------------
  76. * Investigating the properties of the pseudo file system /proc and its
  77. ability to provide information on the running Linux system
  78. * Examining /proc's structure
  79. * Uncovering various information about the kernel and the processes running
  80. on the system
  81. ------------------------------------------------------------------------------
  82. The proc file system acts as an interface to internal data structures in the
  83. kernel. It can be used to obtain information about the system and to change
  84. certain kernel parameters at runtime (sysctl).
  85. First, we'll take a look at the read-only parts of /proc. In Chapter 2, we
  86. show you how you can use /proc/sys to change settings.
  87. 1.1 Process-Specific Subdirectories
  88. -----------------------------------
  89. The directory /proc contains (among other things) one subdirectory for each
  90. process running on the system, which is named after the process ID (PID).
  91. The link self points to the process reading the file system. Each process
  92. subdirectory has the entries listed in Table 1-1.
  93. Table 1-1: Process specific entries in /proc
  94. ..............................................................................
  95. File Content
  96. clear_refs Clears page referenced bits shown in smaps output
  97. cmdline Command line arguments
  98. cpu Current and last cpu in which it was executed (2.4)(smp)
  99. cwd Link to the current working directory
  100. environ Values of environment variables
  101. exe Link to the executable of this process
  102. fd Directory, which contains all file descriptors
  103. maps Memory maps to executables and library files (2.4)
  104. mem Memory held by this process
  105. root Link to the root directory of this process
  106. stat Process status
  107. statm Process memory status information
  108. status Process status in human readable form
  109. wchan If CONFIG_KALLSYMS is set, a pre-decoded wchan
  110. stack Report full stack trace, enable via CONFIG_STACKTRACE
  111. smaps Extension based on maps, the rss size for each mapped file
  112. ..............................................................................
  113. For example, to get the status information of a process, all you have to do is
  114. read the file /proc/PID/status:
  115. >cat /proc/self/status
  116. Name: cat
  117. State: R (running)
  118. Pid: 5452
  119. PPid: 743
  120. TracerPid: 0 (2.4)
  121. Uid: 501 501 501 501
  122. Gid: 100 100 100 100
  123. Groups: 100 14 16
  124. VmSize: 1112 kB
  125. VmLck: 0 kB
  126. VmRSS: 348 kB
  127. VmData: 24 kB
  128. VmStk: 12 kB
  129. VmExe: 8 kB
  130. VmLib: 1044 kB
  131. SigPnd: 0000000000000000
  132. SigBlk: 0000000000000000
  133. SigIgn: 0000000000000000
  134. SigCgt: 0000000000000000
  135. CapInh: 00000000fffffeff
  136. CapPrm: 0000000000000000
  137. CapEff: 0000000000000000
  138. This shows you nearly the same information you would get if you viewed it with
  139. the ps command. In fact, ps uses the proc file system to obtain its
  140. information. The statm file contains more detailed information about the
  141. process memory usage. Its seven fields are explained in Table 1-2. The stat
  142. file contains details information about the process itself. Its fields are
  143. explained in Table 1-3.
  144. Table 1-2: Contents of the statm files (as of 2.6.8-rc3)
  145. ..............................................................................
  146. Field Content
  147. size total program size (pages) (same as VmSize in status)
  148. resident size of memory portions (pages) (same as VmRSS in status)
  149. shared number of pages that are shared (i.e. backed by a file)
  150. trs number of pages that are 'code' (not including libs; broken,
  151. includes data segment)
  152. lrs number of pages of library (always 0 on 2.6)
  153. drs number of pages of data/stack (including libs; broken,
  154. includes library text)
  155. dt number of dirty pages (always 0 on 2.6)
  156. ..............................................................................
  157. Table 1-3: Contents of the stat files (as of 2.6.22-rc3)
  158. ..............................................................................
  159. Field Content
  160. pid process id
  161. tcomm filename of the executable
  162. state state (R is running, S is sleeping, D is sleeping in an
  163. uninterruptible wait, Z is zombie, T is traced or stopped)
  164. ppid process id of the parent process
  165. pgrp pgrp of the process
  166. sid session id
  167. tty_nr tty the process uses
  168. tty_pgrp pgrp of the tty
  169. flags task flags
  170. min_flt number of minor faults
  171. cmin_flt number of minor faults with child's
  172. maj_flt number of major faults
  173. cmaj_flt number of major faults with child's
  174. utime user mode jiffies
  175. stime kernel mode jiffies
  176. cutime user mode jiffies with child's
  177. cstime kernel mode jiffies with child's
  178. priority priority level
  179. nice nice level
  180. num_threads number of threads
  181. it_real_value (obsolete, always 0)
  182. start_time time the process started after system boot
  183. vsize virtual memory size
  184. rss resident set memory size
  185. rsslim current limit in bytes on the rss
  186. start_code address above which program text can run
  187. end_code address below which program text can run
  188. start_stack address of the start of the stack
  189. esp current value of ESP
  190. eip current value of EIP
  191. pending bitmap of pending signals (obsolete)
  192. blocked bitmap of blocked signals (obsolete)
  193. sigign bitmap of ignored signals (obsolete)
  194. sigcatch bitmap of catched signals (obsolete)
  195. wchan address where process went to sleep
  196. 0 (place holder)
  197. 0 (place holder)
  198. exit_signal signal to send to parent thread on exit
  199. task_cpu which CPU the task is scheduled on
  200. rt_priority realtime priority
  201. policy scheduling policy (man sched_setscheduler)
  202. blkio_ticks time spent waiting for block IO
  203. ..............................................................................
  204. 1.2 Kernel data
  205. ---------------
  206. Similar to the process entries, the kernel data files give information about
  207. the running kernel. The files used to obtain this information are contained in
  208. /proc and are listed in Table 1-4. Not all of these will be present in your
  209. system. It depends on the kernel configuration and the loaded modules, which
  210. files are there, and which are missing.
  211. Table 1-4: Kernel info in /proc
  212. ..............................................................................
  213. File Content
  214. apm Advanced power management info
  215. buddyinfo Kernel memory allocator information (see text) (2.5)
  216. bus Directory containing bus specific information
  217. cmdline Kernel command line
  218. cpuinfo Info about the CPU
  219. devices Available devices (block and character)
  220. dma Used DMS channels
  221. filesystems Supported filesystems
  222. driver Various drivers grouped here, currently rtc (2.4)
  223. execdomains Execdomains, related to security (2.4)
  224. fb Frame Buffer devices (2.4)
  225. fs File system parameters, currently nfs/exports (2.4)
  226. ide Directory containing info about the IDE subsystem
  227. interrupts Interrupt usage
  228. iomem Memory map (2.4)
  229. ioports I/O port usage
  230. irq Masks for irq to cpu affinity (2.4)(smp?)
  231. isapnp ISA PnP (Plug&Play) Info (2.4)
  232. kcore Kernel core image (can be ELF or A.OUT(deprecated in 2.4))
  233. kmsg Kernel messages
  234. ksyms Kernel symbol table
  235. loadavg Load average of last 1, 5 & 15 minutes
  236. locks Kernel locks
  237. meminfo Memory info
  238. misc Miscellaneous
  239. modules List of loaded modules
  240. mounts Mounted filesystems
  241. net Networking info (see text)
  242. partitions Table of partitions known to the system
  243. pci Deprecated info of PCI bus (new way -> /proc/bus/pci/,
  244. decoupled by lspci (2.4)
  245. rtc Real time clock
  246. scsi SCSI info (see text)
  247. slabinfo Slab pool info
  248. stat Overall statistics
  249. swaps Swap space utilization
  250. sys See chapter 2
  251. sysvipc Info of SysVIPC Resources (msg, sem, shm) (2.4)
  252. tty Info of tty drivers
  253. uptime System uptime
  254. version Kernel version
  255. video bttv info of video resources (2.4)
  256. vmallocinfo Show vmalloced areas
  257. ..............................................................................
  258. You can, for example, check which interrupts are currently in use and what
  259. they are used for by looking in the file /proc/interrupts:
  260. > cat /proc/interrupts
  261. CPU0
  262. 0: 8728810 XT-PIC timer
  263. 1: 895 XT-PIC keyboard
  264. 2: 0 XT-PIC cascade
  265. 3: 531695 XT-PIC aha152x
  266. 4: 2014133 XT-PIC serial
  267. 5: 44401 XT-PIC pcnet_cs
  268. 8: 2 XT-PIC rtc
  269. 11: 8 XT-PIC i82365
  270. 12: 182918 XT-PIC PS/2 Mouse
  271. 13: 1 XT-PIC fpu
  272. 14: 1232265 XT-PIC ide0
  273. 15: 7 XT-PIC ide1
  274. NMI: 0
  275. In 2.4.* a couple of lines where added to this file LOC & ERR (this time is the
  276. output of a SMP machine):
  277. > cat /proc/interrupts
  278. CPU0 CPU1
  279. 0: 1243498 1214548 IO-APIC-edge timer
  280. 1: 8949 8958 IO-APIC-edge keyboard
  281. 2: 0 0 XT-PIC cascade
  282. 5: 11286 10161 IO-APIC-edge soundblaster
  283. 8: 1 0 IO-APIC-edge rtc
  284. 9: 27422 27407 IO-APIC-edge 3c503
  285. 12: 113645 113873 IO-APIC-edge PS/2 Mouse
  286. 13: 0 0 XT-PIC fpu
  287. 14: 22491 24012 IO-APIC-edge ide0
  288. 15: 2183 2415 IO-APIC-edge ide1
  289. 17: 30564 30414 IO-APIC-level eth0
  290. 18: 177 164 IO-APIC-level bttv
  291. NMI: 2457961 2457959
  292. LOC: 2457882 2457881
  293. ERR: 2155
  294. NMI is incremented in this case because every timer interrupt generates a NMI
  295. (Non Maskable Interrupt) which is used by the NMI Watchdog to detect lockups.
  296. LOC is the local interrupt counter of the internal APIC of every CPU.
  297. ERR is incremented in the case of errors in the IO-APIC bus (the bus that
  298. connects the CPUs in a SMP system. This means that an error has been detected,
  299. the IO-APIC automatically retry the transmission, so it should not be a big
  300. problem, but you should read the SMP-FAQ.
  301. In 2.6.2* /proc/interrupts was expanded again. This time the goal was for
  302. /proc/interrupts to display every IRQ vector in use by the system, not
  303. just those considered 'most important'. The new vectors are:
  304. THR -- interrupt raised when a machine check threshold counter
  305. (typically counting ECC corrected errors of memory or cache) exceeds
  306. a configurable threshold. Only available on some systems.
  307. TRM -- a thermal event interrupt occurs when a temperature threshold
  308. has been exceeded for the CPU. This interrupt may also be generated
  309. when the temperature drops back to normal.
  310. SPU -- a spurious interrupt is some interrupt that was raised then lowered
  311. by some IO device before it could be fully processed by the APIC. Hence
  312. the APIC sees the interrupt but does not know what device it came from.
  313. For this case the APIC will generate the interrupt with a IRQ vector
  314. of 0xff. This might also be generated by chipset bugs.
  315. RES, CAL, TLB -- rescheduling, call and TLB flush interrupts are
  316. sent from one CPU to another per the needs of the OS. Typically,
  317. their statistics are used by kernel developers and interested users to
  318. determine the occurance of interrupt of the given type.
  319. The above IRQ vectors are displayed only when relevent. For example,
  320. the threshold vector does not exist on x86_64 platforms. Others are
  321. suppressed when the system is a uniprocessor. As of this writing, only
  322. i386 and x86_64 platforms support the new IRQ vector displays.
  323. Of some interest is the introduction of the /proc/irq directory to 2.4.
  324. It could be used to set IRQ to CPU affinity, this means that you can "hook" an
  325. IRQ to only one CPU, or to exclude a CPU of handling IRQs. The contents of the
  326. irq subdir is one subdir for each IRQ, and two files; default_smp_affinity and
  327. prof_cpu_mask.
  328. For example
  329. > ls /proc/irq/
  330. 0 10 12 14 16 18 2 4 6 8 prof_cpu_mask
  331. 1 11 13 15 17 19 3 5 7 9 default_smp_affinity
  332. > ls /proc/irq/0/
  333. smp_affinity
  334. smp_affinity is a bitmask, in which you can specify which CPUs can handle the
  335. IRQ, you can set it by doing:
  336. > echo 1 > /proc/irq/10/smp_affinity
  337. This means that only the first CPU will handle the IRQ, but you can also echo
  338. 5 which means that only the first and fourth CPU can handle the IRQ.
  339. The contents of each smp_affinity file is the same by default:
  340. > cat /proc/irq/0/smp_affinity
  341. ffffffff
  342. The default_smp_affinity mask applies to all non-active IRQs, which are the
  343. IRQs which have not yet been allocated/activated, and hence which lack a
  344. /proc/irq/[0-9]* directory.
  345. prof_cpu_mask specifies which CPUs are to be profiled by the system wide
  346. profiler. Default value is ffffffff (all cpus).
  347. The way IRQs are routed is handled by the IO-APIC, and it's Round Robin
  348. between all the CPUs which are allowed to handle it. As usual the kernel has
  349. more info than you and does a better job than you, so the defaults are the
  350. best choice for almost everyone.
  351. There are three more important subdirectories in /proc: net, scsi, and sys.
  352. The general rule is that the contents, or even the existence of these
  353. directories, depend on your kernel configuration. If SCSI is not enabled, the
  354. directory scsi may not exist. The same is true with the net, which is there
  355. only when networking support is present in the running kernel.
  356. The slabinfo file gives information about memory usage at the slab level.
  357. Linux uses slab pools for memory management above page level in version 2.2.
  358. Commonly used objects have their own slab pool (such as network buffers,
  359. directory cache, and so on).
  360. ..............................................................................
  361. > cat /proc/buddyinfo
  362. Node 0, zone DMA 0 4 5 4 4 3 ...
  363. Node 0, zone Normal 1 0 0 1 101 8 ...
  364. Node 0, zone HighMem 2 0 0 1 1 0 ...
  365. Memory fragmentation is a problem under some workloads, and buddyinfo is a
  366. useful tool for helping diagnose these problems. Buddyinfo will give you a
  367. clue as to how big an area you can safely allocate, or why a previous
  368. allocation failed.
  369. Each column represents the number of pages of a certain order which are
  370. available. In this case, there are 0 chunks of 2^0*PAGE_SIZE available in
  371. ZONE_DMA, 4 chunks of 2^1*PAGE_SIZE in ZONE_DMA, 101 chunks of 2^4*PAGE_SIZE
  372. available in ZONE_NORMAL, etc...
  373. ..............................................................................
  374. meminfo:
  375. Provides information about distribution and utilization of memory. This
  376. varies by architecture and compile options. The following is from a
  377. 16GB PIII, which has highmem enabled. You may not have all of these fields.
  378. > cat /proc/meminfo
  379. MemTotal: 16344972 kB
  380. MemFree: 13634064 kB
  381. Buffers: 3656 kB
  382. Cached: 1195708 kB
  383. SwapCached: 0 kB
  384. Active: 891636 kB
  385. Inactive: 1077224 kB
  386. HighTotal: 15597528 kB
  387. HighFree: 13629632 kB
  388. LowTotal: 747444 kB
  389. LowFree: 4432 kB
  390. SwapTotal: 0 kB
  391. SwapFree: 0 kB
  392. Dirty: 968 kB
  393. Writeback: 0 kB
  394. AnonPages: 861800 kB
  395. Mapped: 280372 kB
  396. Slab: 284364 kB
  397. SReclaimable: 159856 kB
  398. SUnreclaim: 124508 kB
  399. PageTables: 24448 kB
  400. NFS_Unstable: 0 kB
  401. Bounce: 0 kB
  402. WritebackTmp: 0 kB
  403. CommitLimit: 7669796 kB
  404. Committed_AS: 100056 kB
  405. VmallocTotal: 112216 kB
  406. VmallocUsed: 428 kB
  407. VmallocChunk: 111088 kB
  408. MemTotal: Total usable ram (i.e. physical ram minus a few reserved
  409. bits and the kernel binary code)
  410. MemFree: The sum of LowFree+HighFree
  411. Buffers: Relatively temporary storage for raw disk blocks
  412. shouldn't get tremendously large (20MB or so)
  413. Cached: in-memory cache for files read from the disk (the
  414. pagecache). Doesn't include SwapCached
  415. SwapCached: Memory that once was swapped out, is swapped back in but
  416. still also is in the swapfile (if memory is needed it
  417. doesn't need to be swapped out AGAIN because it is already
  418. in the swapfile. This saves I/O)
  419. Active: Memory that has been used more recently and usually not
  420. reclaimed unless absolutely necessary.
  421. Inactive: Memory which has been less recently used. It is more
  422. eligible to be reclaimed for other purposes
  423. HighTotal:
  424. HighFree: Highmem is all memory above ~860MB of physical memory
  425. Highmem areas are for use by userspace programs, or
  426. for the pagecache. The kernel must use tricks to access
  427. this memory, making it slower to access than lowmem.
  428. LowTotal:
  429. LowFree: Lowmem is memory which can be used for everything that
  430. highmem can be used for, but it is also available for the
  431. kernel's use for its own data structures. Among many
  432. other things, it is where everything from the Slab is
  433. allocated. Bad things happen when you're out of lowmem.
  434. SwapTotal: total amount of swap space available
  435. SwapFree: Memory which has been evicted from RAM, and is temporarily
  436. on the disk
  437. Dirty: Memory which is waiting to get written back to the disk
  438. Writeback: Memory which is actively being written back to the disk
  439. AnonPages: Non-file backed pages mapped into userspace page tables
  440. Mapped: files which have been mmaped, such as libraries
  441. Slab: in-kernel data structures cache
  442. SReclaimable: Part of Slab, that might be reclaimed, such as caches
  443. SUnreclaim: Part of Slab, that cannot be reclaimed on memory pressure
  444. PageTables: amount of memory dedicated to the lowest level of page
  445. tables.
  446. NFS_Unstable: NFS pages sent to the server, but not yet committed to stable
  447. storage
  448. Bounce: Memory used for block device "bounce buffers"
  449. WritebackTmp: Memory used by FUSE for temporary writeback buffers
  450. CommitLimit: Based on the overcommit ratio ('vm.overcommit_ratio'),
  451. this is the total amount of memory currently available to
  452. be allocated on the system. This limit is only adhered to
  453. if strict overcommit accounting is enabled (mode 2 in
  454. 'vm.overcommit_memory').
  455. The CommitLimit is calculated with the following formula:
  456. CommitLimit = ('vm.overcommit_ratio' * Physical RAM) + Swap
  457. For example, on a system with 1G of physical RAM and 7G
  458. of swap with a `vm.overcommit_ratio` of 30 it would
  459. yield a CommitLimit of 7.3G.
  460. For more details, see the memory overcommit documentation
  461. in vm/overcommit-accounting.
  462. Committed_AS: The amount of memory presently allocated on the system.
  463. The committed memory is a sum of all of the memory which
  464. has been allocated by processes, even if it has not been
  465. "used" by them as of yet. A process which malloc()'s 1G
  466. of memory, but only touches 300M of it will only show up
  467. as using 300M of memory even if it has the address space
  468. allocated for the entire 1G. This 1G is memory which has
  469. been "committed" to by the VM and can be used at any time
  470. by the allocating application. With strict overcommit
  471. enabled on the system (mode 2 in 'vm.overcommit_memory'),
  472. allocations which would exceed the CommitLimit (detailed
  473. above) will not be permitted. This is useful if one needs
  474. to guarantee that processes will not fail due to lack of
  475. memory once that memory has been successfully allocated.
  476. VmallocTotal: total size of vmalloc memory area
  477. VmallocUsed: amount of vmalloc area which is used
  478. VmallocChunk: largest contigious block of vmalloc area which is free
  479. ..............................................................................
  480. vmallocinfo:
  481. Provides information about vmalloced/vmaped areas. One line per area,
  482. containing the virtual address range of the area, size in bytes,
  483. caller information of the creator, and optional information depending
  484. on the kind of area :
  485. pages=nr number of pages
  486. phys=addr if a physical address was specified
  487. ioremap I/O mapping (ioremap() and friends)
  488. vmalloc vmalloc() area
  489. vmap vmap()ed pages
  490. user VM_USERMAP area
  491. vpages buffer for pages pointers was vmalloced (huge area)
  492. N<node>=nr (Only on NUMA kernels)
  493. Number of pages allocated on memory node <node>
  494. > cat /proc/vmallocinfo
  495. 0xffffc20000000000-0xffffc20000201000 2101248 alloc_large_system_hash+0x204 ...
  496. /0x2c0 pages=512 vmalloc N0=128 N1=128 N2=128 N3=128
  497. 0xffffc20000201000-0xffffc20000302000 1052672 alloc_large_system_hash+0x204 ...
  498. /0x2c0 pages=256 vmalloc N0=64 N1=64 N2=64 N3=64
  499. 0xffffc20000302000-0xffffc20000304000 8192 acpi_tb_verify_table+0x21/0x4f...
  500. phys=7fee8000 ioremap
  501. 0xffffc20000304000-0xffffc20000307000 12288 acpi_tb_verify_table+0x21/0x4f...
  502. phys=7fee7000 ioremap
  503. 0xffffc2000031d000-0xffffc2000031f000 8192 init_vdso_vars+0x112/0x210
  504. 0xffffc2000031f000-0xffffc2000032b000 49152 cramfs_uncompress_init+0x2e ...
  505. /0x80 pages=11 vmalloc N0=3 N1=3 N2=2 N3=3
  506. 0xffffc2000033a000-0xffffc2000033d000 12288 sys_swapon+0x640/0xac0 ...
  507. pages=2 vmalloc N1=2
  508. 0xffffc20000347000-0xffffc2000034c000 20480 xt_alloc_table_info+0xfe ...
  509. /0x130 [x_tables] pages=4 vmalloc N0=4
  510. 0xffffffffa0000000-0xffffffffa000f000 61440 sys_init_module+0xc27/0x1d00 ...
  511. pages=14 vmalloc N2=14
  512. 0xffffffffa000f000-0xffffffffa0014000 20480 sys_init_module+0xc27/0x1d00 ...
  513. pages=4 vmalloc N1=4
  514. 0xffffffffa0014000-0xffffffffa0017000 12288 sys_init_module+0xc27/0x1d00 ...
  515. pages=2 vmalloc N1=2
  516. 0xffffffffa0017000-0xffffffffa0022000 45056 sys_init_module+0xc27/0x1d00 ...
  517. pages=10 vmalloc N0=10
  518. 1.3 IDE devices in /proc/ide
  519. ----------------------------
  520. The subdirectory /proc/ide contains information about all IDE devices of which
  521. the kernel is aware. There is one subdirectory for each IDE controller, the
  522. file drivers and a link for each IDE device, pointing to the device directory
  523. in the controller specific subtree.
  524. The file drivers contains general information about the drivers used for the
  525. IDE devices:
  526. > cat /proc/ide/drivers
  527. ide-cdrom version 4.53
  528. ide-disk version 1.08
  529. More detailed information can be found in the controller specific
  530. subdirectories. These are named ide0, ide1 and so on. Each of these
  531. directories contains the files shown in table 1-5.
  532. Table 1-5: IDE controller info in /proc/ide/ide?
  533. ..............................................................................
  534. File Content
  535. channel IDE channel (0 or 1)
  536. config Configuration (only for PCI/IDE bridge)
  537. mate Mate name
  538. model Type/Chipset of IDE controller
  539. ..............................................................................
  540. Each device connected to a controller has a separate subdirectory in the
  541. controllers directory. The files listed in table 1-6 are contained in these
  542. directories.
  543. Table 1-6: IDE device information
  544. ..............................................................................
  545. File Content
  546. cache The cache
  547. capacity Capacity of the medium (in 512Byte blocks)
  548. driver driver and version
  549. geometry physical and logical geometry
  550. identify device identify block
  551. media media type
  552. model device identifier
  553. settings device setup
  554. smart_thresholds IDE disk management thresholds
  555. smart_values IDE disk management values
  556. ..............................................................................
  557. The most interesting file is settings. This file contains a nice overview of
  558. the drive parameters:
  559. # cat /proc/ide/ide0/hda/settings
  560. name value min max mode
  561. ---- ----- --- --- ----
  562. bios_cyl 526 0 65535 rw
  563. bios_head 255 0 255 rw
  564. bios_sect 63 0 63 rw
  565. breada_readahead 4 0 127 rw
  566. bswap 0 0 1 r
  567. file_readahead 72 0 2097151 rw
  568. io_32bit 0 0 3 rw
  569. keepsettings 0 0 1 rw
  570. max_kb_per_request 122 1 127 rw
  571. multcount 0 0 8 rw
  572. nice1 1 0 1 rw
  573. nowerr 0 0 1 rw
  574. pio_mode write-only 0 255 w
  575. slow 0 0 1 rw
  576. unmaskirq 0 0 1 rw
  577. using_dma 0 0 1 rw
  578. 1.4 Networking info in /proc/net
  579. --------------------------------
  580. The subdirectory /proc/net follows the usual pattern. Table 1-6 shows the
  581. additional values you get for IP version 6 if you configure the kernel to
  582. support this. Table 1-7 lists the files and their meaning.
  583. Table 1-6: IPv6 info in /proc/net
  584. ..............................................................................
  585. File Content
  586. udp6 UDP sockets (IPv6)
  587. tcp6 TCP sockets (IPv6)
  588. raw6 Raw device statistics (IPv6)
  589. igmp6 IP multicast addresses, which this host joined (IPv6)
  590. if_inet6 List of IPv6 interface addresses
  591. ipv6_route Kernel routing table for IPv6
  592. rt6_stats Global IPv6 routing tables statistics
  593. sockstat6 Socket statistics (IPv6)
  594. snmp6 Snmp data (IPv6)
  595. ..............................................................................
  596. Table 1-7: Network info in /proc/net
  597. ..............................................................................
  598. File Content
  599. arp Kernel ARP table
  600. dev network devices with statistics
  601. dev_mcast the Layer2 multicast groups a device is listening too
  602. (interface index, label, number of references, number of bound
  603. addresses).
  604. dev_stat network device status
  605. ip_fwchains Firewall chain linkage
  606. ip_fwnames Firewall chain names
  607. ip_masq Directory containing the masquerading tables
  608. ip_masquerade Major masquerading table
  609. netstat Network statistics
  610. raw raw device statistics
  611. route Kernel routing table
  612. rpc Directory containing rpc info
  613. rt_cache Routing cache
  614. snmp SNMP data
  615. sockstat Socket statistics
  616. tcp TCP sockets
  617. tr_rif Token ring RIF routing table
  618. udp UDP sockets
  619. unix UNIX domain sockets
  620. wireless Wireless interface data (Wavelan etc)
  621. igmp IP multicast addresses, which this host joined
  622. psched Global packet scheduler parameters.
  623. netlink List of PF_NETLINK sockets
  624. ip_mr_vifs List of multicast virtual interfaces
  625. ip_mr_cache List of multicast routing cache
  626. ..............................................................................
  627. You can use this information to see which network devices are available in
  628. your system and how much traffic was routed over those devices:
  629. > cat /proc/net/dev
  630. Inter-|Receive |[...
  631. face |bytes packets errs drop fifo frame compressed multicast|[...
  632. lo: 908188 5596 0 0 0 0 0 0 [...
  633. ppp0:15475140 20721 410 0 0 410 0 0 [...
  634. eth0: 614530 7085 0 0 0 0 0 1 [...
  635. ...] Transmit
  636. ...] bytes packets errs drop fifo colls carrier compressed
  637. ...] 908188 5596 0 0 0 0 0 0
  638. ...] 1375103 17405 0 0 0 0 0 0
  639. ...] 1703981 5535 0 0 0 3 0 0
  640. In addition, each Channel Bond interface has it's own directory. For
  641. example, the bond0 device will have a directory called /proc/net/bond0/.
  642. It will contain information that is specific to that bond, such as the
  643. current slaves of the bond, the link status of the slaves, and how
  644. many times the slaves link has failed.
  645. 1.5 SCSI info
  646. -------------
  647. If you have a SCSI host adapter in your system, you'll find a subdirectory
  648. named after the driver for this adapter in /proc/scsi. You'll also see a list
  649. of all recognized SCSI devices in /proc/scsi:
  650. >cat /proc/scsi/scsi
  651. Attached devices:
  652. Host: scsi0 Channel: 00 Id: 00 Lun: 00
  653. Vendor: IBM Model: DGHS09U Rev: 03E0
  654. Type: Direct-Access ANSI SCSI revision: 03
  655. Host: scsi0 Channel: 00 Id: 06 Lun: 00
  656. Vendor: PIONEER Model: CD-ROM DR-U06S Rev: 1.04
  657. Type: CD-ROM ANSI SCSI revision: 02
  658. The directory named after the driver has one file for each adapter found in
  659. the system. These files contain information about the controller, including
  660. the used IRQ and the IO address range. The amount of information shown is
  661. dependent on the adapter you use. The example shows the output for an Adaptec
  662. AHA-2940 SCSI adapter:
  663. > cat /proc/scsi/aic7xxx/0
  664. Adaptec AIC7xxx driver version: 5.1.19/3.2.4
  665. Compile Options:
  666. TCQ Enabled By Default : Disabled
  667. AIC7XXX_PROC_STATS : Disabled
  668. AIC7XXX_RESET_DELAY : 5
  669. Adapter Configuration:
  670. SCSI Adapter: Adaptec AHA-294X Ultra SCSI host adapter
  671. Ultra Wide Controller
  672. PCI MMAPed I/O Base: 0xeb001000
  673. Adapter SEEPROM Config: SEEPROM found and used.
  674. Adaptec SCSI BIOS: Enabled
  675. IRQ: 10
  676. SCBs: Active 0, Max Active 2,
  677. Allocated 15, HW 16, Page 255
  678. Interrupts: 160328
  679. BIOS Control Word: 0x18b6
  680. Adapter Control Word: 0x005b
  681. Extended Translation: Enabled
  682. Disconnect Enable Flags: 0xffff
  683. Ultra Enable Flags: 0x0001
  684. Tag Queue Enable Flags: 0x0000
  685. Ordered Queue Tag Flags: 0x0000
  686. Default Tag Queue Depth: 8
  687. Tagged Queue By Device array for aic7xxx host instance 0:
  688. {255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255}
  689. Actual queue depth per device for aic7xxx host instance 0:
  690. {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}
  691. Statistics:
  692. (scsi0:0:0:0)
  693. Device using Wide/Sync transfers at 40.0 MByte/sec, offset 8
  694. Transinfo settings: current(12/8/1/0), goal(12/8/1/0), user(12/15/1/0)
  695. Total transfers 160151 (74577 reads and 85574 writes)
  696. (scsi0:0:6:0)
  697. Device using Narrow/Sync transfers at 5.0 MByte/sec, offset 15
  698. Transinfo settings: current(50/15/0/0), goal(50/15/0/0), user(50/15/0/0)
  699. Total transfers 0 (0 reads and 0 writes)
  700. 1.6 Parallel port info in /proc/parport
  701. ---------------------------------------
  702. The directory /proc/parport contains information about the parallel ports of
  703. your system. It has one subdirectory for each port, named after the port
  704. number (0,1,2,...).
  705. These directories contain the four files shown in Table 1-8.
  706. Table 1-8: Files in /proc/parport
  707. ..............................................................................
  708. File Content
  709. autoprobe Any IEEE-1284 device ID information that has been acquired.
  710. devices list of the device drivers using that port. A + will appear by the
  711. name of the device currently using the port (it might not appear
  712. against any).
  713. hardware Parallel port's base address, IRQ line and DMA channel.
  714. irq IRQ that parport is using for that port. This is in a separate
  715. file to allow you to alter it by writing a new value in (IRQ
  716. number or none).
  717. ..............................................................................
  718. 1.7 TTY info in /proc/tty
  719. -------------------------
  720. Information about the available and actually used tty's can be found in the
  721. directory /proc/tty.You'll find entries for drivers and line disciplines in
  722. this directory, as shown in Table 1-9.
  723. Table 1-9: Files in /proc/tty
  724. ..............................................................................
  725. File Content
  726. drivers list of drivers and their usage
  727. ldiscs registered line disciplines
  728. driver/serial usage statistic and status of single tty lines
  729. ..............................................................................
  730. To see which tty's are currently in use, you can simply look into the file
  731. /proc/tty/drivers:
  732. > cat /proc/tty/drivers
  733. pty_slave /dev/pts 136 0-255 pty:slave
  734. pty_master /dev/ptm 128 0-255 pty:master
  735. pty_slave /dev/ttyp 3 0-255 pty:slave
  736. pty_master /dev/pty 2 0-255 pty:master
  737. serial /dev/cua 5 64-67 serial:callout
  738. serial /dev/ttyS 4 64-67 serial
  739. /dev/tty0 /dev/tty0 4 0 system:vtmaster
  740. /dev/ptmx /dev/ptmx 5 2 system
  741. /dev/console /dev/console 5 1 system:console
  742. /dev/tty /dev/tty 5 0 system:/dev/tty
  743. unknown /dev/tty 4 1-63 console
  744. 1.8 Miscellaneous kernel statistics in /proc/stat
  745. -------------------------------------------------
  746. Various pieces of information about kernel activity are available in the
  747. /proc/stat file. All of the numbers reported in this file are aggregates
  748. since the system first booted. For a quick look, simply cat the file:
  749. > cat /proc/stat
  750. cpu 2255 34 2290 22625563 6290 127 456 0
  751. cpu0 1132 34 1441 11311718 3675 127 438 0
  752. cpu1 1123 0 849 11313845 2614 0 18 0
  753. intr 114930548 113199788 3 0 5 263 0 4 [... lots more numbers ...]
  754. ctxt 1990473
  755. btime 1062191376
  756. processes 2915
  757. procs_running 1
  758. procs_blocked 0
  759. The very first "cpu" line aggregates the numbers in all of the other "cpuN"
  760. lines. These numbers identify the amount of time the CPU has spent performing
  761. different kinds of work. Time units are in USER_HZ (typically hundredths of a
  762. second). The meanings of the columns are as follows, from left to right:
  763. - user: normal processes executing in user mode
  764. - nice: niced processes executing in user mode
  765. - system: processes executing in kernel mode
  766. - idle: twiddling thumbs
  767. - iowait: waiting for I/O to complete
  768. - irq: servicing interrupts
  769. - softirq: servicing softirqs
  770. - steal: involuntary wait
  771. The "intr" line gives counts of interrupts serviced since boot time, for each
  772. of the possible system interrupts. The first column is the total of all
  773. interrupts serviced; each subsequent column is the total for that particular
  774. interrupt.
  775. The "ctxt" line gives the total number of context switches across all CPUs.
  776. The "btime" line gives the time at which the system booted, in seconds since
  777. the Unix epoch.
  778. The "processes" line gives the number of processes and threads created, which
  779. includes (but is not limited to) those created by calls to the fork() and
  780. clone() system calls.
  781. The "procs_running" line gives the number of processes currently running on
  782. CPUs.
  783. The "procs_blocked" line gives the number of processes currently blocked,
  784. waiting for I/O to complete.
  785. 1.9 Ext4 file system parameters
  786. ------------------------------
  787. Information about mounted ext4 file systems can be found in
  788. /proc/fs/ext4. Each mounted filesystem will have a directory in
  789. /proc/fs/ext4 based on its device name (i.e., /proc/fs/ext4/hdc or
  790. /proc/fs/ext4/dm-0). The files in each per-device directory are shown
  791. in Table 1-10, below.
  792. Table 1-10: Files in /proc/fs/ext4/<devname>
  793. ..............................................................................
  794. File Content
  795. mb_groups details of multiblock allocator buddy cache of free blocks
  796. mb_history multiblock allocation history
  797. ..............................................................................
  798. ------------------------------------------------------------------------------
  799. Summary
  800. ------------------------------------------------------------------------------
  801. The /proc file system serves information about the running system. It not only
  802. allows access to process data but also allows you to request the kernel status
  803. by reading files in the hierarchy.
  804. The directory structure of /proc reflects the types of information and makes
  805. it easy, if not obvious, where to look for specific data.
  806. ------------------------------------------------------------------------------
  807. ------------------------------------------------------------------------------
  808. CHAPTER 2: MODIFYING SYSTEM PARAMETERS
  809. ------------------------------------------------------------------------------
  810. ------------------------------------------------------------------------------
  811. In This Chapter
  812. ------------------------------------------------------------------------------
  813. * Modifying kernel parameters by writing into files found in /proc/sys
  814. * Exploring the files which modify certain parameters
  815. * Review of the /proc/sys file tree
  816. ------------------------------------------------------------------------------
  817. A very interesting part of /proc is the directory /proc/sys. This is not only
  818. a source of information, it also allows you to change parameters within the
  819. kernel. Be very careful when attempting this. You can optimize your system,
  820. but you can also cause it to crash. Never alter kernel parameters on a
  821. production system. Set up a development machine and test to make sure that
  822. everything works the way you want it to. You may have no alternative but to
  823. reboot the machine once an error has been made.
  824. To change a value, simply echo the new value into the file. An example is
  825. given below in the section on the file system data. You need to be root to do
  826. this. You can create your own boot script to perform this every time your
  827. system boots.
  828. The files in /proc/sys can be used to fine tune and monitor miscellaneous and
  829. general things in the operation of the Linux kernel. Since some of the files
  830. can inadvertently disrupt your system, it is advisable to read both
  831. documentation and source before actually making adjustments. In any case, be
  832. very careful when writing to any of these files. The entries in /proc may
  833. change slightly between the 2.1.* and the 2.2 kernel, so if there is any doubt
  834. review the kernel documentation in the directory /usr/src/linux/Documentation.
  835. This chapter is heavily based on the documentation included in the pre 2.2
  836. kernels, and became part of it in version 2.2.1 of the Linux kernel.
  837. Please see: Documentation/sysctls/ directory for descriptions of these
  838. entries.
  839. ------------------------------------------------------------------------------
  840. Summary
  841. ------------------------------------------------------------------------------
  842. Certain aspects of kernel behavior can be modified at runtime, without the
  843. need to recompile the kernel, or even to reboot the system. The files in the
  844. /proc/sys tree can not only be read, but also modified. You can use the echo
  845. command to write value into these files, thereby changing the default settings
  846. of the kernel.
  847. ------------------------------------------------------------------------------
  848. ------------------------------------------------------------------------------
  849. CHAPTER 3: PER-PROCESS PARAMETERS
  850. ------------------------------------------------------------------------------
  851. 3.1 /proc/<pid>/oom_adj - Adjust the oom-killer score
  852. ------------------------------------------------------
  853. This file can be used to adjust the score used to select which processes
  854. should be killed in an out-of-memory situation. Giving it a high score will
  855. increase the likelihood of this process being killed by the oom-killer. Valid
  856. values are in the range -16 to +15, plus the special value -17, which disables
  857. oom-killing altogether for this process.
  858. The process to be killed in an out-of-memory situation is selected among all others
  859. based on its badness score. This value equals the original memory size of the process
  860. and is then updated according to its CPU time (utime + stime) and the
  861. run time (uptime - start time). The longer it runs the smaller is the score.
  862. Badness score is divided by the square root of the CPU time and then by
  863. the double square root of the run time.
  864. Swapped out tasks are killed first. Half of each child's memory size is added to
  865. the parent's score if they do not share the same memory. Thus forking servers
  866. are the prime candidates to be killed. Having only one 'hungry' child will make
  867. parent less preferable than the child.
  868. /proc/<pid>/oom_score shows process' current badness score.
  869. The following heuristics are then applied:
  870. * if the task was reniced, its score doubles
  871. * superuser or direct hardware access tasks (CAP_SYS_ADMIN, CAP_SYS_RESOURCE
  872. or CAP_SYS_RAWIO) have their score divided by 4
  873. * if oom condition happened in one cpuset and checked task does not belong
  874. to it, its score is divided by 8
  875. * the resulting score is multiplied by two to the power of oom_adj, i.e.
  876. points <<= oom_adj when it is positive and
  877. points >>= -(oom_adj) otherwise
  878. The task with the highest badness score is then selected and its children
  879. are killed, process itself will be killed in an OOM situation when it does
  880. not have children or some of them disabled oom like described above.
  881. 3.2 /proc/<pid>/oom_score - Display current oom-killer score
  882. -------------------------------------------------------------
  883. This file can be used to check the current score used by the oom-killer is for
  884. any given <pid>. Use it together with /proc/<pid>/oom_adj to tune which
  885. process should be killed in an out-of-memory situation.
  886. 3.3 /proc/<pid>/io - Display the IO accounting fields
  887. -------------------------------------------------------
  888. This file contains IO statistics for each running process
  889. Example
  890. -------
  891. test:/tmp # dd if=/dev/zero of=/tmp/test.dat &
  892. [1] 3828
  893. test:/tmp # cat /proc/3828/io
  894. rchar: 323934931
  895. wchar: 323929600
  896. syscr: 632687
  897. syscw: 632675
  898. read_bytes: 0
  899. write_bytes: 323932160
  900. cancelled_write_bytes: 0
  901. Description
  902. -----------
  903. rchar
  904. -----
  905. I/O counter: chars read
  906. The number of bytes which this task has caused to be read from storage. This
  907. is simply the sum of bytes which this process passed to read() and pread().
  908. It includes things like tty IO and it is unaffected by whether or not actual
  909. physical disk IO was required (the read might have been satisfied from
  910. pagecache)
  911. wchar
  912. -----
  913. I/O counter: chars written
  914. The number of bytes which this task has caused, or shall cause to be written
  915. to disk. Similar caveats apply here as with rchar.
  916. syscr
  917. -----
  918. I/O counter: read syscalls
  919. Attempt to count the number of read I/O operations, i.e. syscalls like read()
  920. and pread().
  921. syscw
  922. -----
  923. I/O counter: write syscalls
  924. Attempt to count the number of write I/O operations, i.e. syscalls like
  925. write() and pwrite().
  926. read_bytes
  927. ----------
  928. I/O counter: bytes read
  929. Attempt to count the number of bytes which this process really did cause to
  930. be fetched from the storage layer. Done at the submit_bio() level, so it is
  931. accurate for block-backed filesystems. <please add status regarding NFS and
  932. CIFS at a later time>
  933. write_bytes
  934. -----------
  935. I/O counter: bytes written
  936. Attempt to count the number of bytes which this process caused to be sent to
  937. the storage layer. This is done at page-dirtying time.
  938. cancelled_write_bytes
  939. ---------------------
  940. The big inaccuracy here is truncate. If a process writes 1MB to a file and
  941. then deletes the file, it will in fact perform no writeout. But it will have
  942. been accounted as having caused 1MB of write.
  943. In other words: The number of bytes which this process caused to not happen,
  944. by truncating pagecache. A task can cause "negative" IO too. If this task
  945. truncates some dirty pagecache, some IO which another task has been accounted
  946. for (in it's write_bytes) will not be happening. We _could_ just subtract that
  947. from the truncating task's write_bytes, but there is information loss in doing
  948. that.
  949. Note
  950. ----
  951. At its current implementation state, this is a bit racy on 32-bit machines: if
  952. process A reads process B's /proc/pid/io while process B is updating one of
  953. those 64-bit counters, process A could see an intermediate result.
  954. More information about this can be found within the taskstats documentation in
  955. Documentation/accounting.
  956. 3.4 /proc/<pid>/coredump_filter - Core dump filtering settings
  957. ---------------------------------------------------------------
  958. When a process is dumped, all anonymous memory is written to a core file as
  959. long as the size of the core file isn't limited. But sometimes we don't want
  960. to dump some memory segments, for example, huge shared memory. Conversely,
  961. sometimes we want to save file-backed memory segments into a core file, not
  962. only the individual files.
  963. /proc/<pid>/coredump_filter allows you to customize which memory segments
  964. will be dumped when the <pid> process is dumped. coredump_filter is a bitmask
  965. of memory types. If a bit of the bitmask is set, memory segments of the
  966. corresponding memory type are dumped, otherwise they are not dumped.
  967. The following 7 memory types are supported:
  968. - (bit 0) anonymous private memory
  969. - (bit 1) anonymous shared memory
  970. - (bit 2) file-backed private memory
  971. - (bit 3) file-backed shared memory
  972. - (bit 4) ELF header pages in file-backed private memory areas (it is
  973. effective only if the bit 2 is cleared)
  974. - (bit 5) hugetlb private memory
  975. - (bit 6) hugetlb shared memory
  976. Note that MMIO pages such as frame buffer are never dumped and vDSO pages
  977. are always dumped regardless of the bitmask status.
  978. Note bit 0-4 doesn't effect any hugetlb memory. hugetlb memory are only
  979. effected by bit 5-6.
  980. Default value of coredump_filter is 0x23; this means all anonymous memory
  981. segments and hugetlb private memory are dumped.
  982. If you don't want to dump all shared memory segments attached to pid 1234,
  983. write 0x21 to the process's proc file.
  984. $ echo 0x21 > /proc/1234/coredump_filter
  985. When a new process is created, the process inherits the bitmask status from its
  986. parent. It is useful to set up coredump_filter before the program runs.
  987. For example:
  988. $ echo 0x7 > /proc/self/coredump_filter
  989. $ ./some_program
  990. 3.5 /proc/<pid>/mountinfo - Information about mounts
  991. --------------------------------------------------------
  992. This file contains lines of the form:
  993. 36 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue
  994. (1)(2)(3) (4) (5) (6) (7) (8) (9) (10) (11)
  995. (1) mount ID: unique identifier of the mount (may be reused after umount)
  996. (2) parent ID: ID of parent (or of self for the top of the mount tree)
  997. (3) major:minor: value of st_dev for files on filesystem
  998. (4) root: root of the mount within the filesystem
  999. (5) mount point: mount point relative to the process's root
  1000. (6) mount options: per mount options
  1001. (7) optional fields: zero or more fields of the form "tag[:value]"
  1002. (8) separator: marks the end of the optional fields
  1003. (9) filesystem type: name of filesystem of the form "type[.subtype]"
  1004. (10) mount source: filesystem specific information or "none"
  1005. (11) super options: per super block options
  1006. Parsers should ignore all unrecognised optional fields. Currently the
  1007. possible optional fields are:
  1008. shared:X mount is shared in peer group X
  1009. master:X mount is slave to peer group X
  1010. propagate_from:X mount is slave and receives propagation from peer group X (*)
  1011. unbindable mount is unbindable
  1012. (*) X is the closest dominant peer group under the process's root. If
  1013. X is the immediate master of the mount, or if there's no dominant peer
  1014. group under the same root, then only the "master:X" field is present
  1015. and not the "propagate_from:X" field.
  1016. For more information on mount propagation see:
  1017. Documentation/filesystems/sharedsubtree.txt