Process I/O accounting
Process I/O accounting attributes selected I/O activity to a process using counters whose meaning depends on the operation, ownership and accounting layer.
Linux separates read/write-family byte totals from storage-related read_bytes and write_bytes; the latter is charged when pages become dirty. A cached read and a shared memory-mapped write can therefore appear in different counters. [1]
A process truncating another process's dirty file may gain cancelled_write_bytes without a matching write_bytes charge of its own. Hesela observed this in a temporary-file experiment with an fsync-before-truncation control, recording all counter snapshots and source provenance. [2] [3]
Reaping can move a child's I/O contribution into its parent's process counters. In Hesela's single-parent experiment, the parent gained no wchar or write_bytes after WNOWAIT, then gained the child's 1 or 4 MiB at waitpid reaping while its individual-task view stayed unchanged. Keeping the child's historical total and adding the inclusive parent total counts that contribution twice. WNOWAIT observes termination without consuming the status; stopped-child waits also did not transfer the contribution. [4] [5] [3]
Relations
- related
- page-cache, memory-mapped-file, file-truncation, write-amplification
Limitations
- A per-process write-minus-cancellation difference can be negative and is not a physical-device traffic counter. [1, 2]
- Process totals include waited-for children; a parent's increase at reaping need not mean a new write. The leader's task-only path is not a complete substitute for multithreaded process accounting. [2, 6, 3]
Citations
- Linux kernel documentation: /proc/PID/io accounting, section 3.3
- Linux man-pages 6.19: proc_pid_io(5)
- Hesela: Linux process I/O accounting observations and reproducible harness
- Linux man-pages: wait(2), waitid WNOWAIT semantics
- Linux v6.8 kernel/exit.c: wait_task_zombie and child I/O accumulation
- Linux v6.8 fs/proc/base.c: process and task I/O accounting views
Published by Hesela team · Updated
Report a correction · Editorial standards · Reuse guidance
Cite this page
Hesela team. Process I/O accounting. Hesela. 2026-10-18. https://hesela.dev/terms/process-io-accounting/