K 10 svn:author V 7 glebius K 8 svn:date V 27 2014-02-12T20:06:26.711696Z K 7 svn:log V 938 Make the sendfile(2) call non-blocking on disk I/O, but unlike SF_NODISKIO, still performing the I/O. The new call is a drop-in replacement for older sendfile(2), so applications like web-servers do not need to be recompiled or reconfigured to achieve the benefit. The mechanics of the change are the following: o We grab enough pages to fill the socket buffer. o We iterate through pages, and request I/O on those, that are not valid. The I/O is requested via VOP_GETPAGES_ASYNC(), so it doesn't block. o If we did initiated any I/Os, then we send data to the buffer as SB_NOTREADY data, since I/Os are still in progress. And return. o Once the last I/O completes, we mark our data in socket as ready, and if we were the blocker of the socket, then we initiate send. The code still has quite a lot of rough places, but has already been tested at Netflix with positive results. Sponsored by: Netflix Sponsored by: Nginx, Inc. END