[PATCH] Only lock send buffer in sopoll() if needed

Rui Paulo rpaulo at me.com
Sun Oct 5 06:33:00 UTC 2014


On Sep 30, 2014, at 11:00, John Baldwin <jhb at freebsd.org> wrote:
> 
> Right now sopoll() always locks both socket buffers.  The receive socket 
> buffer lock is always needed, but the send socket buffer lock is only needed 
> while polling for writing (there is a potential test of SBS_CANTSENDMORE 
> without the lock, but I think this might be ok).  What do folks think?

Does this really help us much?  Are you worried about sending data when another thread is polling?

The patch looks ok, but I'm not sure about the handling of POLLHUP.  I suppose that's okay since if that flag is set, the socket is disconnected.

--
Rui Paulo





More information about the freebsd-net mailing list