dd: ignore a failed cache drop while copying - #14748
ChihweiLHBird wants to merge 1 commit into
Conversation
Merging this PR will degrade performance by 3.43%
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
|
GNU testsuite comparison: |
5b69be5 to
ae1248c
Compare
|
I looked into the CodSpeed report. The regression is real but small, and it comes from compiler register allocation rather than from any added work.
Cause. None of these benchmarks pass I couldn't find a variant of this fix reaches zero instructions increase. Another variant, adding a bunch of |
0c61751 to
82c41b3
Compare
Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
82c41b3 to
5da8c11
Compare
Summary
iflag=nocacheandoflag=nocachediagnosed every failed cache drop, so copying from or to a pipe printedfailed to discard cache for: 'standard input': Illegal seekonce per read and exited 1 even though the copy succeeded. GNU ignores those failures while copying and diagnoses them only withcount=0, where dropping the cache is the whole job: "when count=0, failure to discard the cache is diagnosed and reflected in the exit status" (manual,dd invocation; theinvalidate_cachecallers indd.c).Input::discard_cacheandOutput::discard_cachenow return the error instead of printing it, and the two callers decide:dd_copyignores it,flush_caches_full_length(thecount=0path) reports it and sets the exit status.Part of #14705 (
tests/dd/nocache.sh).Example
dd if=/dev/zero bs=1M count=1 status=none | dd iflag=nocache bs=1M of=/dev/nullBefore (exit 1):
After, the same as GNU 9.12 (exit 0):
count=0is unchanged and still diagnoses the failure, as GNU does: