lkml.org 
[lkml]   [2009]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectsplice() on unix sockets
I found that splice() can operate from a pipe to a unix socket, but from a 
unix socket to a pipe fails with EINVAL.

On investigation, splicing from a pipe to a unix socket (af_unix.c) gets
routed through a regular unix_stream_sendmsg (via sock_no_sendpage). If my
understanding is correct this means it will copy memory and not
references, so it's not actually a splice.

If so, splice() behaves inconsistently; sometimes it fails on unsupported
file descriptors, sometimes it falls back to a copy. The man page favours
the former, but the latter could also be useful -- to call splice() with
any pair of fds and have the kernel do the best it can.

Splicing between unix sockets and pipes would give a useful performance
benefit. Is there any work in progress on this? Are there any caveats to
implementing it?

Thanks,

--
Mark


\
 
 \ /
  Last update: 2009-04-23 01:09    [W:0.027 / U:4.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site