Page MenuHomeFreeBSD

Set MORETOCOME for AIO write requests on a socket.
ClosedPublic

Authored by jhb on Dec 28 2016, 5:58 PM.

Details

Summary

Set MORETOCOME for AIO write requests on a socket.

Add a MSG_MOREOTOCOME message flag. When this flag is set, sosend*
set PRUS_MOREOTOCOME when invoking the protocol send method. The aio
worker tasks for sending on a socket set this flag when there are
additional write jobs waiting on the socket buffer.

Test Plan
  • tested nginx 1.8 using aio_write for sockets and found that when an HTTP reply was split across multiple AIO requests, the resulting data was not coalesced into MSS packets the same way as if writev() were used to write all the segments together.

Note that this is imperfect as we might set MORETOCOME and then not
send more data if the second AIO write is cancelled before it is
sent. This can happen in regular sockets if a write is interrupted
as well.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jhb updated this revision to Diff 23348.Dec 28 2016, 5:58 PM
jhb retitled this revision from to Set MORETOCOME for AIO write requests on a socket..
jhb updated this object.
jhb edited the test plan for this revision. (Show Details)
jhb added a subscriber: network.Dec 28 2016, 5:58 PM
adrian accepted this revision.Dec 28 2016, 7:40 PM
adrian added a reviewer: adrian.
adrian added a subscriber: adrian.

i think it's okay. The fact the lower level behaviour isn't completely defined isn't the fault of this patch :)

This revision is now accepted and ready to land.Dec 28 2016, 7:40 PM
This revision was automatically updated to reflect the committed changes.