--- man-pages-2.54/man5/proc.5 2007-05-16 11:25:50.000000000 -0700 +++ man-pages-2.54/man5/proc.5.new 2007-06-09 11:10:15.000000000 -0700 @@ -41,6 +41,9 @@ .\" 2005-09-19, mtk, added /proc/zoneinfo .\" 2005-03-01, mtk, moved /proc/sys/fs/mqueue/* material to .\" mq_overview.7. +.\" 2007-06-10 Added /proc/[number]/{oom_score,oom_adj,io,seccomp} +.\" by Jeff Schroeder +.\" mostly copied from Documentation/filesystems/proc.txt. .\" .\" FIXME 2.6.14 has /proc/PID/numa_maps (if CONFIG_NUMA is .\" enabled); this needs to be documented. @@ -201,6 +204,128 @@ .\" FIXME Describe /proc/[number]/loginuid .\" Added in 2.6.11; updating requires CAP_AUDIT_CONTROL .TP +.I /proc/[number]/io "Since 2.6.20" +This file contains I/O statistics for each running process. +It is only present when the CONFIG_TASK_IO_ACCOUNTING and +CONFIG_TASK_XACCT kernel configuration options are enabled. + +.B Example + +.nf +.in +5 +$ dd if=/dev/zero of=/tmp/test.dat & +[1] 3828 + +$ cat /proc/3828/io +rchar: 323934931 +wchar: 323929600 +syscr: 632687 +syscw: 632675 +read_bytes: 0 +write_bytes: 323932160 +cancelled_write_bytes: 0 +.fi +.in + +.B Descriptions +.IP +.in +5 +.I rchar +.br +I/O counter: chars read +.br +The number of bytes which this task has caused to be read from storage. +This is simply the sum of bytes which this process passed to +.BR read (2) +and +.BR pread (2). +It includes things like tty I/O and it is unaffected by whether +or not actual physical disk I/O was required +(the read might have been satisfied from pagecache). +.in +.IP +.in +5 +.I wchar +.br +I/O counter: chars written +.br +The number of bytes which this task has caused, or shall cause to be +written to disk. +Similar caveats apply here as with rchar. +.in +.IP +.in +5 +.I syscr +.br +I/O counter: read syscalls +.br +Attempt to count the number of read I/O operations as in syscalls like +.BR read (2) +and +.BR pread (2). +.in +.IP +.in +5 +.I syscw +.br +I/O counter: write syscalls +.br +Attempt to count the number of write I/O operations as in syscalls like +.BR write (2) +and +.BR pwrite (2). +.in +.IP +.in +5 +.I read_bytes +.br +I/O counter: bytes read +.br +Attempt to count the number of bytes which this process caused to be +fetched from the storage layer. +This is done at the submit_bio() level, so it is accurate for +block-backed filesystems. +.in +.IP +.in +5 +.I write_bytes +.br +I/O counter: bytes written +.br +Attempt to count the number of bytes which this process caused to be +sent to the storage layer. +This is done at page-dirtying time. +.in +.IP +.in +5 +.I cancelled_write_bytes +.br +This is to show when truncating a file overinflates the number of bytes +written when they were in fact not actually written to disk. +If a process writes 1MB to a file and then deletes the file, it will +perform no writeout. +However, it will have been accounted as having caused 1MB of write. +This can also be seen as the number of bytes which this process caused +to not happen, by truncating pagecache. +A task can cause "negative" I/O too. +If this task truncates some dirty pagecache, some I/O which another +task has been accounted for (in it's write_bytes) will not be happening. +We _could_ just subtract that from the truncating task's write_bytes, +but there is information loss in doing that. +.in +.IP +.in +5 +.I Note +.br +As currently implemented, this is a bit racy on 32-bit systems. +If process A reads process B's /proc/[number]/io while process +B is updating one of those 64-bit counters, process A could see an +intermediate result. + +More information can be found within the taskstats documentation in the +kernel source code under Documentation/accounting. +.in +.TP .I /proc/[number]/maps A file containing the currently mapped memory regions and their access permissions.