All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Kellermann <max@duempel.org>
To: Andi Kleen <andi@firstfloor.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: splice() on two pipes
Date: Wed, 29 Apr 2009 21:42:55 +0200	[thread overview]
Message-ID: <20090429194254.GA7956@squirrel.roonstrasse.net> (raw)
In-Reply-To: <87my9zpjqe.fsf@basil.nowhere.org>

On 2009/04/29 17:23, Andi Kleen <andi@firstfloor.org> wrote:
> I don't think splice is about handling all possible cases,
> but just cases where the kernel can do better than user space.
> I don't think that's the case here.

If splice() is about passing pointers of a pipe buffer, what's more
trivial (and natural) than passing that pointer between two pipes?

> > when I read about the splice() system call, I thought it was obvious
> > that it could copy data between two pipes. 
> 
> It would be more efficient if you used fd passing to pass the fd
> around to the other process and let it read directly.

That's not so easy in my case.  The header output of the one process
has to be parsed before the rest of it (or part of the rest) is going
to be forwarded to the second one.  My master process would lose
control over the transfer.  splice() looks like the perfect solution.

Max

  reply	other threads:[~2009-04-29 19:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-29 10:33 splice() on two pipes Max Kellermann
2009-04-29 15:23 ` Andi Kleen
2009-04-29 19:42   ` Max Kellermann [this message]
2009-04-30  4:56     ` Willy Tarreau
2009-04-30 14:26       ` Mark Hills
2009-04-30  6:21 ` Jens Axboe
2009-04-30  6:42   ` Max Kellermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090429194254.GA7956@squirrel.roonstrasse.net \
    --to=max@duempel.org \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.