3 ms·
You could also say that the aio interface, which has aio_read() and aio_write() calls, is missing an "aio_transfer()" call. Just a quick idea, would mmapped fi
by amelius 11y ago
You could also say that the aio interface, which has aio_read() and aio_write() calls, is missing an "aio_transfer()" call.
Just a quick idea, would mmapped files, combined with the aio_write() interface not give us the same functionality as sendfile()?
- jsolson 11y agoMaybe. It depends on whether or not the kernel is smart enough to recognize that the pages you've referenced in the AIO operation are pages are mmap'd files rather than ordinary heap memory. It would need to do some amount of page table walking to learn that, but certainly for a large enough operation that would be cheaper than simply making the copy. I suspect that Linux, at least, does not do this. That said, I'm curious about the difficulty of plumbing such an optimization. Unfortunately due to other implementation details of the networking stack I work on day to day it wouldn't have any implications for that, but it might have some for one of my side projects.