Repository navigation
dd: stop the copy-buffer RSS check from racing other tests - #14804
Merged
Merged
Conversation
VmHWM is reported as the maximum of the stored watermark and the current RSS, so a reading taken while another test thread holds pages can come out higher than a later one, and after - before underflowed. Take the measurement in a child process running this test alone, and compute the growth with a saturating subtraction.
sylvestre
reviewed
Sep 22, 2026
sylvestre
reviewed
Sep 22, 2026
sylvestre
reviewed
Sep 22, 2026
The unit test read /proc/self/status, which is shared with every other test in the binary, so it had to re-exec itself to get a quiet process. Running the real dd instead and reading the child's own peak RSS through wait4 drops that machinery and removes the race.
abendrothj
force-pushed
the
fix/dd-copy-buffer-rss-test
branch
from
September 25, 2026 02:55
05f056c to
a4904b4
Compare
Contributor
Merging this PR will not alter performance
Comparing Footnotes
|
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.
copy_buffer_does_not_touch_its_pagesfailed intermittently in CI withattempt to subtract with overflow(seen on x86_64-unknown-linux-musl). It readVmHWMfrom/proc/self/status, which is shared with every other test in the binary — the kernel reportsVmHWMas the maximum of the stored watermark and the current RSS, so a reading taken while another test thread held pages could come out higher than the later one.The check now lives in
tests/by-util/test_dd.rs, runs the realddwithbs=4G, and reads that child process's own peak RSS fromwait4, so nothing running in parallel can affect it. On Linux the growth over abs=4Kbaseline stays within ~150 KiB across runs against a 64 MiB bound, and goes to ~4 GiB if the buffer's pages are touched.