Re: [PATCH 1/3 v2] chunkd: remove sendfile(2) zero-copy support
Jeff Garzik <[email protected]> Sun, 18 Jul 2010 19:10:09 -0400
| Newsgroups | org.kernel.vger.hail-devel |
|---|---|
| Message-ID | <[email protected]> |
On 07/17/2010 11:45 PM, Steven Dake wrote: > On 07/16/2010 10:46 PM, Jeff Garzik wrote: >> chunkd: remove sendfile(2) zero-copy support >> >> chunkd will be soon checksumming data in main memory. That removes >> the utility of a zero-copy interface which bypasses the on-heap >> data requirement. >> >> Signed-off-by: Jeff Garzik<[email protected]> > May be able to use vmsplice with sendfile (if linux is only target > platform). Haven't tried it myself, but the operations look interesting > at achieving zero copy with sockets from memory addresses. Even though the man pages say "only for pipes", this syscall definitely works with TCP. The big question: is it actually faster than read()+write() ? Years ago, I experimented with using some fancy new Linux-specific syscalls in a from-scratch implementation of cp(1). It turned out that read()+write() was faster than other methods. That was file->file copying. It's probably worth investigating vmsplice() for our file->checksum->TCP case, definitely. Jeff