mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: Ingo Molnar <mingo@elte.hu>
Cc: Linus Torvalds <torvalds@osdl.org>,
	linux-kernel@vger.kernel.org, akpm@osdl.org
Subject: Re: [PATCH] splice support #2
Date: Fri, 31 Mar 2006 20:18:27 +0200	[thread overview]
Message-ID: <20060331181827.GC14022@suse.de> (raw)
In-Reply-To: <20060331124754.GB15331@elte.hu>

On Fri, Mar 31 2006, Ingo Molnar wrote:
> 
> * Jens Axboe <axboe@suse.de> wrote:
> 
> > > > with pipe-based buffering this approach has still the very same problems 
> > > > that sendfile() has with packet boundaries, because it's not enough to 
> > > > have "large enough" buffering (like a pipe has), the pipe also has to be 
> > > > drained, and the networking layer has to know the precise boundary of 
> > > > data.
> > > > 
> > > > the right solution to the packet boundary problem is to pass in a proper 
> > > > "does userspace expect more data right now" flag, or to let userspace 
> > > > 'flush' the socket independently - which is independent of the 
> > > > pipe-in-slice issue. This solution already exists: the MSG_MORE flag.
> > > 
> > > We can add a SPLICE_F_MORE flag for this, right now splice doesn't set
> > > the MSG_MORE flag for the end of the pipe.
> > 
> > Ala
> 
> >  #define SPLICE_F_MOVE	(0x01)	/* move pages instead of copying */
> > +#define SPLICE_F_MORE	(0x02)	/* expect more data */
> 
> ok, nice - something like this should work. The direction of the flag is 
> a philosophical question i guess: i believe in Linux we prefer to 
> default to "buffering enabled", i.e. the default flag should be "expect 
> more data". So maybe it would be better to pass in PLICE_F_END, to 
> indicate end-of-data. [it doesnt mean 'permanent end', so all the files 
> still remain open: this could be something like a HTTP 1.1 pipelined 
> request.]

Hmm I do prefer a MORE as to an END, as it will always give predictable
results. The MORE is a performance hit, where as a missing END wont
necessarily be detected until you start looking at latencies.

> furthermore, the internal implementation should also get smarter and do 
> a flush-socket if it would e.g. block on a pagecache page. [we often 
> prefer a partial packet in such cases instead of having a half-built 
> packet hang around.]

That's a really good idea! Wont be too much trouble to add, probably the
easiest is to add a 'wait' variable to the ->map() function or something
along those lines.

> btw., that 'data boundary' detail is likely lost with the pipe 
> intermediary solution: there is no direct connection between 'input 
> file' and 'output socket', so a 'flush now' event doesnt get propagated 
> in a natural way. (unless we extend pipes with 'data boundary' markers, 
> or force their flushing, which looks a whole lot of complexity for such 
> a simple thing.)

Probably not.

-- 
Jens Axboe


  reply	other threads:[~2006-03-31 18:18 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-30 10:06 Jens Axboe
2006-03-30 10:16 ` Andrew Morton
2006-03-30 10:24   ` Jens Axboe
2006-03-30 11:16     ` Andrew Morton
2006-03-30 11:55       ` Jens Axboe
2006-03-30 12:30         ` Jens Axboe
2006-03-30 12:30           ` Jens Axboe
2006-03-30 19:19           ` Andrew Morton
2006-03-30 12:00 ` Ingo Molnar
2006-03-30 12:05   ` Jens Axboe
2006-03-30 12:10     ` Ingo Molnar
2006-03-30 12:16       ` Jens Axboe
2006-03-30 12:38         ` Ingo Molnar
2006-03-30 12:42           ` Jens Axboe
2006-03-30 12:42             ` Ingo Molnar
2006-03-30 13:02               ` Jens Axboe
2006-03-30 14:20           ` Christoph Hellwig
2006-03-30 17:02     ` Linus Torvalds
2006-03-30 17:17       ` Linus Torvalds
2006-03-31 20:38         ` Hua Zhong
2006-03-31 20:49           ` Linus Torvalds
2006-03-30 20:48       ` Jeff Garzik
2006-03-30 21:16         ` Linus Torvalds
2006-03-31  0:59           ` Nick Piggin
2006-03-31  2:43             ` Andrew Morton
2006-03-31  2:51               ` Andrew Morton
2006-03-31  3:20                 ` Nick Piggin
2006-03-31  6:35                 ` Christoph Hellwig
2006-03-31  7:09           ` Ingo Molnar
2006-04-02 22:33             ` Pavel Machek
2006-03-31 12:46           ` Bernd Petrovitsch
2006-03-31  9:56       ` Jens Axboe
2006-03-31 12:18       ` Ingo Molnar
2006-03-31 12:23         ` Jens Axboe
2006-03-31 12:26           ` Jens Axboe
2006-03-31 12:47             ` Ingo Molnar
2006-03-31 18:18               ` Jens Axboe [this message]
2006-03-31 12:27       ` Ingo Molnar
2006-03-31  0:03 linux
2006-03-31  6:06 tridge
2006-03-31  6:59 ` Antonio Vargas
2006-03-31  7:37   ` tridge
2006-03-31  9:57 ` Jens Axboe
2006-03-31 19:11   ` Linus Torvalds
2006-03-31 19:40     ` Jens Axboe
2006-04-04 17:16       ` Andy Lutomirski
2006-04-04 17:34         ` Jens Axboe
     [not found] <5W2gv-Tp-19@gated-at.bofh.it>
     [not found] ` <5W48C-3KW-17@gated-at.bofh.it>
     [not found]   ` <5W48D-3KW-21@gated-at.bofh.it>
     [not found]     ` <5W8OT-2ms-17@gated-at.bofh.it>
     [not found]       ` <5WcfS-7x9-23@gated-at.bofh.it>
     [not found]         ` <5WcIT-8nr-13@gated-at.bofh.it>
     [not found]           ` <5Wm5I-53z-7@gated-at.bofh.it>
     [not found]             ` <5XjoS-8t9-11@gated-at.bofh.it>
2006-04-03 12:39               ` Bodo Eggert

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=20060331181827.GC14022@suse.de \
    --to=axboe@suse.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@osdl.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome