Repository navigation
benchmarks: count a stacked block device once in the container io figures (#555) - #570
Merged
Merged
Conversation
…ures (#555) cgroup v2 io.stat charges a write to a device-mapper device on it AND on the disk under it. read_io_stat and parse_io_stat summed every line, so the io_* fields were 2x on the mini (259:0 NVMe + 252:0 dm, identical wbytes). A listed device is now skipped when it is a slave (transitively, partitions resolved to whole disks) of another listed device per /sys/dev/block/*/slaves; the top of the stack is kept, unrelated disks still add up, and a device with no sysfs entry is counted as before. sysfs root is injectable for tests. Return keys are unchanged and no row field is added. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…#555) The stamp says the row's io figures count a stacked block device once, so the freeze (the companion PR, which declares the column to page_check and provenance_check and merges first) tells a fixed row from a pre-fix one without a cutoff time. One key in the one row literal the runner builds. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Nov 6, 2026
tae898
marked this pull request as ready for review
November 6, 2026 09:30
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.
Refs #555. The io part of the issue. This PR merges SECOND, after #571.
The bug:
runner.read_io_statandmemory_probe.parse_io_statsummed every device line of a container's cgroup v2io.stat. On the mini the file lists259:0(NVMe) and252:0(a device-mapper device stacked on it) with identical bytes, plus an unrelated8:0with 0 bytes, so every figure derived from it was recorded at about twice its value.The fix: a listed device is skipped when it is a slave (directly or through further layers, partitions resolved to their whole disk) of another listed device, per
/sys/dev/block/<maj:min>/slaves. The top of the stack is kept, unrelated disks still add up, and a device with no sysfs entry is counted as before. The sysfs root is injectable for tests. The first commit is 6c9c58b from the four-arm branch (#554), cherry-picked onto currentmainwithout conflicts.The stamp: the runner now writes
io_stat_dedup: 1into every row, in the one row literal it builds (next toinstrument; everyio_*field of a row is written by this runner). A row carrying it counts a stacked device once, so the freeze can tell a fixed row from a pre-fix one without a cutoff time. #571 reads the stamp, halves the io figures of mini rows that lack it in the frozen copy only, and declares the column topage_check(NOT_PRINTED) andprovenance_check(schema homogeneity, so a cell whose reps straddle the fix still passes). That is why #571 must merge first: with this PR onmainand #571 not, the next freeze would failpage_checkon the unknown column.What changes:
read_io_statinrunner.pydelegates toparse_io_stat,parse_io_statinmemory_probe.pygets the stacked-device rule, and the runner row gets one added key. This does change the runner path, but only by that key and the dedup function; the stage scripts are unaffected until the mini pullsmainafter the merge. Apart from the new stamp, the only row fields whose values change are theio_*ones (io_read_mib,io_write_mib, the_sumpair, the per-side{client,server,server_container,sidecar_*}_io_*fields and the memory probe'sio_<phase>_{read,write}_mib). I read the diff for that: therunner.pyhunks are the one function and the one key, and thememory_probe.pyhunk is the one function plus its helpers. The return keys (rbytes,wbytes) are unchanged. One behaviour difference outside the rule: a malformed token inio.statis now skipped instead of makingread_io_statreturn{}.Tests: seven tests for the dedup rule and one for the stamp in
test_memory_probe.py(stacked pair counted once, two-layer stack, unrelated third device still counted, no sysfs info counts every device, bad input, the runner delegating to the same rule, the stamp placed in the row literal before any io field is written). I called the functions directly and they pass; CI runs them on this PR.compile(),pyflakes(no new warnings overmain) and the repo's pre-commit hooks on the changed files are clean.Merge is held on purpose, on two conditions that must both be true. First, #571 is merged. Second, the mini pass has finished the qC22 and qC23 re-runs, so the pass splits cleanly into rows before and after the fix (the stage scripts pull
mainat every stage start). Merge condition, one line: #571 is merged ANDssh mini 'grep -c "REORDER reruns finished" ~/STATUS.txt'prints 1 or more. Not ready for review until then.🤖 Generated with Claude Code