Repository navigation
store, svg: what each process read from and wrote to disk - #4
Merged
Merged
Conversation
The IO graphs show a boot's bursts, 230 MB/s of reads from 0.1 to 0.14 s on spin-stack/machine's, and nothing said whose they were. read_bytes and write_bytes come from /proc/PID/io on every sample in which the process ran: a process submits a read or dirties a page only while it runs, so a sample in which it did not keeps the last values, and costs no read. Each process's label says what it read and wrote, an orange strip under its bar marks the intervals in which it did, a "Top disk I/O" table lists who did the most, and the unit table sums both by unit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aledbf
force-pushed
the
per-process-io
branch
from
November 22, 2026 16:10
92d0371 to
89cd9bd
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
spin-stack/machine draws its boot with this fork to see how systemd starts inside a ~300-400 ms VM boot on one vCPU, and to catch regressions release to release. Its chart shows a 230 MB/s read burst from 0.1 to 0.14 s and a write burst from 0.1 to 0.22 s, while the vCPU is nearly idle. Nothing in the chart says whose reads and writes they were, so the lead "the disk holds systemd's first ~40 ms" (spin-stack/machine#521) could not be followed to a process or a unit.
What
read_bytesandwrite_bytesfrom/proc/PID/iofor every process that ran since the last sample. A process submits a read or dirties a page only while it runs, so a sample in which it did not run keeps the last values and costs no read. A kernel withoutCONFIG_TASK_IO_ACCOUNTINGhas no/proc/PID/io, and the values stay zero.3.0ms, 12.0MB read, 2.5MB written.-c) sums both by unit.read_bytescounts what the block layer read for the process, so page-cache hits do not count.write_bytescounts the bytes it dirtied, which writeback writes later and possibly from a kworker.Checked
tests/ioruns over a fixture/procwhere journald reads 12 MB and writes 2.5 MB while it runs. Its counters then jump to 99 MB without any CPU time, which a real process cannot do. The test asserts the label, both tables and the strip. It also asserts that the chart keeps 12 MB, which showsiois read only on samples in which the process ran.make checkpasses under ASan/UBSan with gcc in an Ubuntu 24.04 container. CI covers clang.Stacked on #3.
🤖 Generated with Claude Code