Skip to content

yes: use tee syscall as pipe only fast-path#11458

Open
oech3 wants to merge 1 commit intouutils:mainfrom
oech3:yes-tee
Open

yes: use tee syscall as pipe only fast-path#11458
oech3 wants to merge 1 commit intouutils:mainfrom
oech3:yes-tee

Conversation

@oech3
Copy link
Contributor

@oech3 oech3 commented Mar 23, 2026

Add fast-path only valid for pipe output:
tee is unstable compared with vmsplice (about 28~35GiB) but better than sendfile.

sendfile code-path is still needed for the case GNU added -z for fast zero generator.

Closes #11454 .
I don't know how to align pipe by 1 MiB.

@oech3 oech3 force-pushed the yes-tee branch 3 times, most recently from 57ce5eb to 1506d10 Compare March 23, 2026 00:15
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 23, 2026

Merging this PR will not alter performance

✅ 300 untouched benchmarks
⏩ 46 skipped benchmarks1


Comparing oech3:yes-tee (c5f3e96) with main (9943286)

Open in CodSpeed

Footnotes

  1. 46 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@oech3 oech3 force-pushed the yes-tee branch 2 times, most recently from 0c0949b to 32606d4 Compare March 23, 2026 00:28
@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/cut/bounded-memory (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/pr/bounded-memory (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/seq/seq-epipe is no longer failing!

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/seq/seq-epipe is no longer failing!
Note: The gnu test tests/expand/bounded-memory is now being skipped but was previously passing.

@oech3 oech3 marked this pull request as ready for review March 23, 2026 01:31
@github-actions
Copy link

GNU testsuite comparison:

Note: The gnu test tests/expand/bounded-memory is now being skipped but was previously passing.
Note: The gnu test tests/printf/printf-surprise is now being skipped but was previously passing.

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/misc/io-errors. tests/misc/io-errors is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/tail/symlink (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/date/resolution (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/basenc/bounded-memory is now passing!
Congrats! The gnu test tests/dd/no-allocate is now passing!
Congrats! The gnu test tests/expand/bounded-memory is now passing!

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/unexpand/bounded-memory is now being skipped but was previously passing.
Congrats! The gnu test tests/printf/printf-surprise is now passing!

@oech3
Copy link
Contributor Author

oech3 commented Mar 23, 2026

Why is CI too flakey?

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/cut/bounded-memory (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/cp/link-heap is now being skipped but was previously passing.
Note: The gnu test tests/seq/seq-epipe is now being skipped but was previously passing.
Note: The gnu test tests/unexpand/bounded-memory is now being skipped but was previously passing.
Congrats! The gnu test tests/printf/printf-surprise is now passing!

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/timeout/timeout-group. tests/timeout/timeout-group is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/tty/tty-eof (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/tail/tail-n0f is now being skipped but was previously passing.
Congrats! The gnu test tests/basenc/bounded-memory is now passing!

@oech3
Copy link
Contributor Author

oech3 commented Mar 23, 2026

CI fails by unrelated reason too many times. But this is ready.

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/pr/bounded-memory (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/basenc/bounded-memory is now passing!

@oech3
Copy link
Contributor Author

oech3 commented Mar 23, 2026

It seems tee is faster than vmsplice with enough RAM (bandwidth?)

> taskset -c 1 yes-tee|taskset -c 2 pv>/dev/null
[50.9GiB/s]
> taskset -c 1 yes-vmsplice|taskset -c 2 pv>/dev/null
[47.5GiB/s]

> taskset -c 1 gnu5ec45a1aa/yes|taskset -c 2 pv>/dev/null
[49.6GiB/s]

and LD_PRELOAD=/usr/lib/libmimalloc.so does not help with enough RAM.
@ArniDagur

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/printf/printf-surprise is now passing!
Note: The gnu test tests/env/env-signal-handler was skipped on 'main' but is now failing.

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/rm/isatty. tests/rm/isatty is passing on 'main'. Maybe you have to rebase?
Congrats! The gnu test tests/misc/io-errors is no longer failing!
Note: The gnu test tests/seq/seq-epipe is now being skipped but was previously passing.
Note: The gnu test tests/tail/tail-n0f is now being skipped but was previously passing.
Congrats! The gnu test tests/csplit/csplit-heap is now passing!

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/misc/io-errors. tests/misc/io-errors is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/tail/follow-name (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/tail/pipe-f2 is no longer failing!
Note: The gnu test tests/tail/pipe-f is now being skipped but was previously passing.
Congrats! The gnu test tests/tail/tail-n0f is now passing!

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/tail/pipe-f2 is no longer failing!
Congrats! The gnu test tests/tail/tail-n0f is now passing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

yes: use tee syscall for performance

1 participant