Interoperation of Copy Avoidance in Network and File I/O

21 March 1999

New Image

Copy avoidance techniques for network I/O often assume that server buffers are ephemeral (i.e., are deallocated as soon as I/O processing completes). Such techniques cannot be used for file I/O, where buffers may need to be cached long-term. Mapped file I/O, however, can easily provide copy avoidance for cached server buffers. This paper demonstrates experimentally that mapped file I/O interoperates correctly with emulated copy, a recently proposed copy avoidance scheme for ephemeral server buffers. The resulting solution allows data to be passed between networks and file systems without copying and without changing existing interfaces. Greatest benefits are obtained when copying is avoided both in network and file I/O. Two new optimizations are contributed: header patching, for stripping packet headers and restoring page alignment without hardware support; and user-directed page swapping, for passing data between regions without copying. These optimizations are useful also for network I/O with operating system bypass or with non-copy semantics.