async zero-copy read&x

Andrew Bartlett abartlet at
Mon Jun 21 19:15:32 MDT 2010

On Sun, 2010-06-20 at 18:43 +0200, Volker Lendecke wrote:
> Hi!
> Under
> find some code that uses splice(2) to do read&x in an async
> and zero-copy fashion. It fetches data from disk using one
> splice call in an async fashion, and then assumes that the
> splice call from the pipe to the TCP socket is just moving
> around some pointers in the kernel, thus won't block. It
> heavy tuning and clean-up before I will propose it, but it
> might be a start for some discussion about the design and
> optimizations.

The idea of inline asm to make the raw syscalls scares me a little, but
from what discussions I've seen you in on IRC, it seems like we don't
have good options here...

> One thing we could do is to use the tmembuf abstraction and
> do async pread into that when for example splice(2) is not
> available or if we want to do signing. I'm planning to add
> some tmembuf_md5 or tmembuf_sha256 routines to do this.

I'm really glad that SMB signing hasn't been left out of this.  I know
it slows things down and isn't used in so many places, but I'm glad it's
not been just put on the slow path.

That said, I've not seen tmembuf before - what is is?

Andrew Bartlett

More information about the samba-technical mailing list