Re: [PATCH 0/3] vmsplice: make vmsplice a trivial wrapper for preadv2/pwritev2
From: David Laight
Date: Wed Jun 10 2026 - 06:05:11 EST
On Wed, 10 Jun 2026 13:09:19 +0800
Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> wrote:
> Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > Because I think splice() is a *cool* feature. It was always *clever*.
> > I just don't think it's worth the pain it has cause.
> >
> > And it's been around for a long long time, and after more than two
> > decades it's still most definitely not _widely_ used.
>
> A couple of years ago I used tee(2) in dash(1) so that we could
> avoid reading the input line byte-by-byte which is what every other
> shell does in order to pass the rest of stdin to the executed
> command.
The shell just needs something like MSG_PEEK to do a non-consuming
read from a pipe.
(Without the strange behaviour of a second offset.)
That would be simple and could have been implemented 40 years ago.
-- David
>
> https://git.kernel.org/pub/scm/utils/dash/dash.git/commit/?id=44b15ea09a9ee5872cf477e4ffc6b42ef37d1e46
>
> It's definitely niche but made a huge performance difference to
> this rather common scenario:
>
> echo 'command
> ...
> rest of stdin' | sh
>
> I didn't even know tee(2) prior to this, even though it was added
> way back.
>
> Thanks,