Debian Codegraph @

upstream/debian-unstable/man5/proc_pid_io.5

raw
1 .\" Copyright 1994-1995, Daniel Quinlan <[email protected]>
2 .\" Copyright 2002-2017, Michael Kerrisk <[email protected]>
3 .\" Copyright, the authors of the Linux man-pages project
4 .\"
5 .\" SPDX-License-Identifier: GPL-3.0-or-later
6 .\"
7 .TH proc_pid_io 5 2026-02-08 "Linux man-pages 6.18"
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
14 This file contains I/O statistics
15 for the process and its waited-for children,
16 for example:
17 .IP
18 .in +4n
19 .EX
20 .RB "#" " cat /proc/3828/io"
21 rchar: 323934931
22 wchar: 323929600
23 syscr: 632687
24 syscw: 632675
25 read_bytes: 0
26 write_bytes: 323932160
27 cancelled_write_bytes: 0
28 .EE
29 .in
30 .IP
31 The fields are as follows:
32 .RS
33 .TP
34 .IR rchar ": characters read"
35 The number of bytes
36 returned by successful
37 .BR read (2)
38 and similar system calls.
39 .TP
40 .IR wchar ": characters written"
41 The number of bytes
42 returned by successful
43 .BR write (2)
44 and similar system calls.
45 .TP
46 .IR syscr ": read syscalls"
47 The number of "file read" system calls\[em]those from the
48 .BR read (2)
49 family,
50 .BR sendfile (2),
51 .BR copy_file_range (2),
52 and
53 .BR ioctl (2)
54 .BR BTRFS_IOC_ENCODED_READ [ _32 ]
55 (including when invoked by the kernel as part of other syscalls).
56 .TP
57 .IR syscw ": write syscalls"
58 The number of "file write" system calls\[em]those from the
59 .BR write (2)
60 family,
61 .BR sendfile (2),
62 .BR copy_file_range (2),
63 and
64 .BR ioctl (2)
65 .BR BTRFS_IOC_ENCODED_WRITE [ _32 ]
66 (including when invoked by the kernel as part of other syscalls).
67 .TP
68 .IR read_bytes ": bytes read"
69 The number of bytes really fetched from the storage layer.
70 This is accurate for block-backed filesystems.
71 .TP
72 .IR write_bytes ": bytes written"
73 The number of bytes really sent to the storage layer.
74 .TP
75 .IR cancelled_write_bytes :
76 The above statistics fail to account for truncation:
77 if a process writes 1 MB to a regular file and then removes it,
78 said 1 MB will not be written, but
79 .I will
80 have nevertheless been accounted as a 1 MB write.
81 This field represents the number of bytes "saved" from I/O writeback.
82 This can yield to having done negative I/O
83 if caches dirtied by another process are truncated.
84 .I cancelled_write_bytes
85 applies to I/O already accounted-for in
86 .IR write_bytes .
87 .RE
88 .IP
89 Permission to access this file is governed by
90 .BR ptrace (2)
91 access mode
92 .BR PTRACE_MODE_READ_FSCREDS .
93 .SH CAVEATS
94 These counters are not atomic:
95 on systems where 64-bit integer operations may tear,
96 a counter could be updated simultaneously with a read,
97 yielding an incorrect intermediate value.
98 .SH SEE ALSO
99 .BR getrusage (2),
100 .BR proc (5)