]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man5/proc_pid_io.5
proc_sys.5, proc_sys_dev.5: Split /proc/sys/dev/ from proc_sys(5)
[thirdparty/man-pages.git] / man5 / proc_pid_io.5
CommitLineData
b47bcfdd
AC
1.\" Copyright (C) 1994, 1995, Daniel Quinlan <quinlan@yggdrasil.com>
2.\" Copyright (C) 2002-2008, 2017, Michael Kerrisk <mtk.manpages@gmail.com>
3.\" Copyright (C) 2023, Alejandro Colomar <alx@kernel.org>
4.\"
5.\" SPDX-License-Identifier: GPL-3.0-or-later
6.\"
7.TH proc_pid_io 5 (date) "Linux man-pages (unreleased)"
8.SH NAME
9/proc/pid/io \- I/O statistics
10.SH DESCRIPTION
11.TP
12.IR /proc/ pid /io " (since Linux 2.6.20)"
13.\" commit 7c3ab7381e79dfc7db14a67c6f4f3285664e1ec2
14This file contains I/O statistics for the process, for example:
15.IP
16.in +4n
17.EX
18.RB "#" " cat /proc/3828/io"
19rchar: 323934931
20wchar: 323929600
21syscr: 632687
22syscw: 632675
23read_bytes: 0
24write_bytes: 323932160
25cancelled_write_bytes: 0
26.EE
27.in
28.IP
29The fields are as follows:
30.RS
31.TP
32.IR rchar ": characters read"
33The number of bytes which this task has caused to be read from storage.
34This is simply the sum of bytes which this process passed to
35.BR read (2)
36and similar system calls.
37It includes things such as terminal I/O and
38is unaffected by whether or not actual
39physical disk I/O was required (the read might have been satisfied from
40pagecache).
41.TP
42.IR wchar ": characters written"
43The number of bytes which this task has caused, or shall cause to be written
44to disk.
45Similar caveats apply here as with
46.IR rchar .
47.TP
48.IR syscr ": read syscalls"
49Attempt to count the number of read I/O operations\[em]that is,
50system calls such as
51.BR read (2)
52and
53.BR pread (2).
54.TP
55.IR syscw ": write syscalls"
56Attempt to count the number of write I/O operations\[em]that is,
57system calls such as
58.BR write (2)
59and
60.BR pwrite (2).
61.TP
62.IR read_bytes ": bytes read"
63Attempt to count the number of bytes which this process really did cause to
64be fetched from the storage layer.
65This is accurate for block-backed filesystems.
66.TP
67.IR write_bytes ": bytes written"
68Attempt to count the number of bytes which this process caused to be sent to
69the storage layer.
70.TP
71.IR cancelled_write_bytes :
72The big inaccuracy here is truncate.
73If a process writes 1 MB to a file and then deletes the file,
74it will in fact perform no writeout.
75But it will have been accounted as having caused 1 MB of write.
76In other words: this field represents the number of bytes which this process
77caused to not happen, by truncating pagecache.
78A task can cause "negative" I/O too.
79If this task truncates some dirty pagecache,
80some I/O which another task has been accounted for
81(in its
82.IR write_bytes )
83will not be happening.
84.RE
85.IP
86.IR Note :
87In the current implementation, things are a bit racy on 32-bit systems:
88if process A reads process B's
89.IR /proc/ pid /io
90while process B is updating one of these 64-bit counters,
91process A could see an intermediate result.
92.IP
93Permission to access this file is governed by a ptrace access mode
94.B PTRACE_MODE_READ_FSCREDS
95check; see
96.BR ptrace (2).
97.SH SEE ALSO
98.BR proc (5)