Ticket #3 (closed enhancement: wontfix)
Write to pipe log using vmsplice()
| Reported by: | edsiper | Owned by: | edsiper |
|---|---|---|---|
| Priority: | minor | Milestone: | Future Release |
| Component: | Logger | Version: | |
| Keywords: | Cc: |
Description
Linux kernel provides a syscall named vmsplice() which allows to write an
iov struct with zero copy to a pipe, we must use vmsplice() instead of
writev() for that procedure.
Change History
Note: See
TracTickets for help on using
tickets.

I was skimming through the code and it came to my attention the following commented snippet:
/* for some reason, vmsplice is not working as expected for us, * maybe we need to fix something here, at the moment * we will keep using writev to push the iovec struct to the pipe * * * n = vmsplice(fd, * (const struct iovec *) mk_io->io, * mk_io->iov_idx, * SPLICE_F_GIFT); * return n; */1) vmsplice's man page states that when the SPLICE_F_GIFT flag is present, the memory pointed by each iovec's iov_base MUST be aligned to page boundary:
which, if one dumps the iov_base addresses at run-time, they're not.
2) BUT if we remove SPLICE_F_GIFT, the logger writes to the files with interleaved garbage from the response headers; I haven't checked why.