proc_pid_io(5)

๐Ÿ’– proc_pid_io โ€” I/O statistics ๐Ÿ’–

okay bestie so you found the proc_pid_io(5) page in the File Formats Manual section, and honestly? it's a little gem. it's the manual for /proc/pid/io, the file that spills all the tea about a process's I/O. let's get into it ๐Ÿซถ


โœจ NAME โœจ

/proc/pid/io โ€” I/O statistics. that's it, that's the whole vibe ๐Ÿ’…


๐ŸŒธ DESCRIPTION ๐ŸŒธ

so /proc/pid/io has been sitting there since Linux 2.6.20 (yes, ancient, iconic, a legend). it holds the I/O statistics for a process and its waited-for children. like, the whole family tree of I/O.

here's what it looks like when you peek at it, fr fr:

# cat /proc/3828/io
rchar: 323934931
wchar: 323929600
syscr: 632687
syscw: 632675
read_bytes: 0
write_bytes: 323932160
cancelled_write_bytes: 0

and now the field-by-field breakdown, because you know I'm gonna explain every single one ๐Ÿ‘‘

๐ŸŽ€ the fields ๐ŸŽ€

  • rchar: characters read โ€” the number of bytes returned by successful read(2) and similar system calls. it's giving "how much did this thing actually pull in".
  • wchar: characters written โ€” the number of bytes returned by successful write(2) and similar system calls. the outgoing side of the story โœจ
  • syscr: read syscalls โ€” the number of "file read" system calls. that means the whole read(2) family, plus sendfile(2), copy_file_range(2), and the ioctl(2) BTRFS_IOC_ENCODED_READ[_32] one โ€” and that includes when the kernel invokes them as part of other syscalls. sneaky kernel behavior, we love to see it documented.
  • syscw: write syscalls โ€” the number of "file write" system calls. same deal: the write(2) family, sendfile(2), copy_file_range(2), and ioctl(2) BTRFS_IOC_ENCODED_WRITE[_32] โ€” including when the kernel calls them as part of other syscalls.
  • read_bytes: bytes read โ€” the number of bytes really fetched from the storage layer. and it's accurate for block-backed filesystems, periodt. ๐Ÿ”ฅ
  • write_bytes: bytes written โ€” the number of bytes really sent to the storage layer.
  • cancelled_write_bytes: โ€” okay bestie this one needs a second. the stats above do not account for truncation. so picture it: a process writes 1 MB to a regular file and then deletes it. that 1 MB never actually gets written, but it was still counted as a 1 MB write ๐Ÿ™ˆ. this field is the number of bytes that got "saved" from I/O writeback. and lowkey it can go negative โ€” like, actually negative I/O โ€” if caches that were dirtied by another process get truncated. also important: cancelled_write_bytes applies to I/O already accounted-for in write_bytes.

๐Ÿ” who's allowed in ๐Ÿ”

permission to access this file is governed by ptrace(2) access mode PTRACE_MODE_READ_FSCREDS. so it's not a free-for-all, bestie.


๐Ÿ’€ CAVEATS ๐Ÿ’€

these counters are not atomic. on systems where 64-bit integer operations may tear, a counter could get updated at the exact same moment as a read, and you'd end up with an incorrect intermediate value. so if a number looks cursed, it might genuinely be cursed. not a vibe, but forewarned is forearmed ๐Ÿ’œ

๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹


and that's the whole page, bestie!! ๐ŸŽ€ this was Linux man-pages 6.20, dated 2026-02-08, and you just read proc_pid_io(5) like a true main character. go check your own /proc/pid/io and slay ๐Ÿ’…โœจ๐Ÿซถ

๐Ÿ“ฆ where this page comes from
  • arch rolling: man-pages 6.20-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • ๐Ÿ“œ the page's license: GPL-3.0-or-later
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms