All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ofer Heifetz <oferh@marvell.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Changli Gao <xiaosuo@gmail.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: RE: Splice status
Date: Mon, 5 Jul 2010 16:47:56 +0300	[thread overview]
Message-ID: <EE71107DF0D1F24FA2D95041E64AB9E8ED2541B6E4@IL-MB01.marvell.com> (raw)
In-Reply-To: <1278334254.2877.158.camel@edumazet-laptop>

Hi,

Well, Samba still disables splice support (hard coded), I applied your patch (adding the SPLICE_F_NONBLOCK to the splice(sock, pipe)) and I managed to write 4G file to Samba share.

I did notice that the splice is done on buffers in two sizes: 1380 and 2760 (when writing to share file), I guess that if I can get samba to use bigger buffers it will reduce the splice calls and achieve better performance.

I also saw that when re-writing a file splice does use the maximum buffer size (~16K) occasionally.

Need to perform some more testing with samba splice ...

-Ofer

-----Original Message-----
From: Eric Dumazet [mailto:eric.dumazet@gmail.com] 
Sent: Monday, July 05, 2010 3:51 PM
To: Ofer Heifetz
Cc: Changli Gao; netdev@vger.kernel.org
Subject: RE: Splice status

Le lundi 05 juillet 2010 à 13:52 +0300, Ofer Heifetz a écrit :
> I am using Samba, so from my understanding of the source code, it
loops and performs splice(sock, pipe) and splice(pipe, fd). There is no
flush of any sort in between.
> 
> When you say drain you mean to flush all data to pipe?
> 

Draining pipe before splice() call would only trigger the bug less
often.

splice(sock, pipe) can block if caller dont use appropriate "non
blocking pipe' splice() mode, even if pipe is empty before a splice()
call.

Last time I checked, splice() code was disabled in samba.

Is it a patched version ?

Samba should add SPLICE_F_NONBLOCK to first splice() call (from sock to
pipe)

(You also need a recent kernel, check for details :
http://patchwork.ozlabs.org/patch/34511/ )

diff --git a/source3/lib/recvfile.c b/source3/lib/recvfile.c
index ea01596..65e6f34 100644
--- a/source3/lib/recvfile.c
+++ b/source3/lib/recvfile.c
@@ -182,7 +182,7 @@ ssize_t sys_recvfile(int fromfd,
                int nread, to_write;
 
                nread = splice(fromfd, NULL, pipefd[1], NULL,
-                              MIN(count, 16384), SPLICE_F_MOVE);
+                              MIN(count, 16384), SPLICE_F_MOVE | SPLICE_F_NONBLOCK);
                if (nread == -1) {
                        if (errno == EINTR) {
                                continue;



  reply	other threads:[~2010-07-05 13:49 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-05  9:26 Splice status Ofer Heifetz
2010-07-05  9:59 ` Changli Gao
2010-07-05 10:52   ` Ofer Heifetz
2010-07-05 12:08     ` Changli Gao
2010-07-05 12:50     ` Eric Dumazet
2010-07-05 13:47       ` Ofer Heifetz [this message]
2010-07-05 15:34         ` Eric Dumazet
2010-07-06  2:01       ` Changli Gao
2010-07-06  2:36         ` Ofer Heifetz
2010-07-06  3:56         ` Eric Dumazet
2010-07-11 13:08           ` Changli Gao
2010-07-13 11:41             ` Ofer Heifetz
2010-07-13 12:32               ` Changli Gao
2010-07-13 12:42                 ` Ofer Heifetz
2010-07-13 13:58                   ` Changli Gao
2010-07-13 14:40                     ` Ofer Heifetz
2010-07-13 14:11               ` Eric Dumazet
2010-07-14 15:08                 ` Ofer Heifetz
2010-07-15  3:47                 ` Ofer Heifetz
2010-07-25 14:47                 ` Ofer Heifetz
2010-07-26  7:41                   ` Changli Gao
2010-07-26 20:37                   ` Jarek Poplawski
2010-07-26 20:50                     ` Eric Dumazet
  -- strict thread matches above, loose matches on Subject: below --
2006-04-20 14:29 splice status Jens Axboe
2006-04-20 23:00 ` Christoph Hellwig

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=EE71107DF0D1F24FA2D95041E64AB9E8ED2541B6E4@IL-MB01.marvell.com \
    --to=oferh@marvell.com \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=xiaosuo@gmail.com \
    /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.