[clug] does splice work?

Peter Barker pbarker at barker.dropbear.id.au
Sat Jun 19 18:28:39 MDT 2010

On Thu, 17 Jun 2010, oferh wrote:

> I am trying to enable recvfile (splice) on samba 3.4.3 running Linux
> 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!


> linux mailing list

Peter Barker                          |   Programmer,Sysadmin,Geek.
pbarker at barker.dropbear.id.au	      |   You need a bigger hammer.
:: It's a hack! Expect underscores! - Nigel Williams

More information about the linux mailing list