[clug] does splice work?

oferh oferh at marvell.com
Sun Jun 20 04:34:03 MDT 2010


Hi Peter,

When the process returns zero it continuously calls splice (not blocking)
and never ends, thus the process consumes 100% and I have to kill it to
terminate it.

My question here is to understand if someone has made the splice work, I
found several patches to Kernel:
http://patchwork.ozlabs.org/patch/17613/ maximum buffer size for splice
tcp->pipe 
http://permalink.gmane.org/gmane.linux.network/138828 Splice on blocking TCP
sockets again 
http://kerneltrap.org/mailarchive/linux-netdev/2009/11/5/6260005 set
SPLICE_F_NONBLOCK after first buffer has been spliced 

So it look like there is some issue with blocking TCP socket that needs to
be resolved.
But since splice is not enabled in Samba by default (you need to patch it to
make it work) my assumption is that it is still not ready.

-Ofer


Peter Barker-2 wrote:
> 
> On Thu, 17 Jun 2010, oferh wrote:
> 
>> I am trying to enable recvfile (splice) on samba 3.4.3 running Linux
>> 2.6.31.8 to get better write performance.
> 
> Sounds like a good idea.
> 
>> I am able to copy up to 81M part of a file to the samba share and then
>> the
>> copy stops.
> 
> Reliably - at the same numer of bytes transfered?
> 
>> Using min receivefile size = 128k in smb.conf
>>
>> I enabled log level 10 to see that splice is being used (sys_recvfile in
>> log) and also stracing shows the system call invoked.
> 
> ...
> 
>> SYS_340(0x1a, 0, 0x1f, 0, 0x4000)       = 16384
> 
> ...
> 
>> And then after some time it copied part of the file I see:
>> SYS_340(0x1a, 0, 0x1f, 0, 0x4000)       = 0
>>
>> It looks like splice is returning zero to syscall and samba does not
>> treat
>> this return call and continues the copy loop.
> 
> Reading the manpage, a return value of zero is not an EOF condition for 
> splice.  That probably means that samba is correctly continuing the loop. 
> OTOH, the manpage also state it will only return that if there are no 
> writers - perhaps the client was disconnected?  What does tcpdump say?
> 
> Zero here *probably* means the network didn't supply data this time 
> around.  What state does the process end up in?  Is it blocked on a 
> syscall?  Looping indefinitely?  Terminated?
> 
>> Has anyone succeeded making splice work on large files on recent kernels
>> ?
> 
> Ah.  Now I'll get to the reason I responded, not knowing myself a huge 
> amount about either splice or the innards of samba.  This is actually the 
> mailing list of the Canberra Linux User's Group.  It is not a list about 
> samba on linux :-)
> 
> You probably want either the "samba at samba.org" mailing list, or perhaps 
> "samba-technical at samba.org" mailing list.  Those lists are much more 
> likely to contain members who can directly answer your question!
> 
> https://lists.samba.org/mailman/
> 
> 
>> linux mailing list
> 
> Yours,
> -- 
> Peter Barker                          |   Programmer,Sysadmin,Geek.
> pbarker at barker.dropbear.id.au	      |   You need a bigger hammer.
> :: It's a hack! Expect underscores! - Nigel Williams
> -- 
> linux mailing list
> linux at lists.samba.org
> https://lists.samba.org/mailman/listinfo/linux
> 
> 

-- 
View this message in context: http://old.nabble.com/does-splice-work--tp28922375p28939967.html
Sent from the Samba - linux mailing list archive at Nabble.com.



More information about the linux mailing list