public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Volker.Lendecke@SerNet.DE
Cc: linux-kernel@vger.kernel.org, Steven French <sfrench@us.ibm.com>,
	Jens Axboe <jens.axboe@oracle.com>,
	netdev@vger.kernel.org
Subject: Re: maximum buffer size for splice(2) tcp->pipe?
Date: Tue, 13 Jan 2009 12:37:02 -0800	[thread overview]
Message-ID: <20090113123702.ad29cd13.akpm@linux-foundation.org> (raw)
In-Reply-To: <E1LKrp3-004Tub-IR@intern.SerNet.DE>

(cc's added)

On Thu, 8 Jan 2009 11:13:51 +0100
Volker Lendecke <Volker.Lendecke@SerNet.DE> wrote:

> Hi!
> 
> While implementing splice support in Samba for better
> performance I found it blocking when trying to pull data off
> tcp into a pipe when the recvq was full. Attached find a
> test program that shows this behaviour, on another host I
> started
> 
> netcat 192.168.19.10 4711 < /dev/zero
> 
> vlendec@lenny:~$ uname -a
> Linux lenny 2.6.28-06857-g5cbd04a #7 Wed Jan 7 10:10:42 CET 2009 x86_64 = GNU/Linux
> vlendec@lenny:~$ gcc -o splicetest /host/home/vlendec/splicetest.c -O3 -Wall
> vlendec@lenny:~$ ./splicetest out 65536 &
> [1] 697
> vlendec@lenny:~$ strace -p 697
> Process 697 attached - interrupt to quit
> splice(0x3, 0, 0x5, 0, 0x56a0, 0x1)     = 22176
> splice(0x7, 0, 0x4, 0, 0x10000, 0x1^C <unfinished ...>
> Process 697 detached
> vlendec@lenny:~$ netstat -nt | grep 4711
> tcp    69272      0 192.168.19.10:4711 192.168.19.1:33773 ESTABLISHED
> vlendec@lenny:~$
> 
> Interestingly, whenever I start the strace, it gets another
> chunk of data and then blocks in the next splice call.
> 
> If I start splicetest with a buffer size of 16384 instead of
> 65536, it does not block. I could not find a way to ask the
> kernel for the tipping point below which it does not block.
> 
> What is a safe buffer size to use with splice?
> 
> BTW, this kernel is from Steve French's linux-cifs.git repo.
> 
> Thanks,
> 
> Volker Lendecke
> 
> Samba Team
> 
> P.S: I'm not subscribed to linux-kernel, so if possible
> please CC me directly. If this is inappropriate behaviour,
> please give me a quick hint :-)
> 


  reply	other threads:[~2009-01-13 20:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-08 10:13 maximum buffer size for splice(2) tcp->pipe? Volker Lendecke
2009-01-13 20:37 ` Andrew Morton [this message]
2009-01-13 23:15   ` Eric Dumazet
2009-01-13 23:38     ` Eric Dumazet
2009-01-15  4:58       ` David Miller
2009-01-15 11:47         ` Eric Dumazet
2009-01-14  7:40     ` Volker Lendecke
2009-01-14  9:13       ` Eric Dumazet
2009-01-14 10:03         ` Volker Lendecke
2009-01-14 10:17           ` Eric Dumazet

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=20090113123702.ad29cd13.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=Volker.Lendecke@SerNet.DE \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sfrench@us.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox