Page MenuHomeFreeBSD

sockets: retire sorflush()
ClosedPublic

Authored by glebius on Jan 12 2024, 10:08 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 14, 10:41 AM
Unknown Object (File)
Tue, Oct 14, 10:41 AM
Unknown Object (File)
Tue, Oct 14, 10:41 AM
Unknown Object (File)
Mon, Oct 13, 8:27 PM
Unknown Object (File)
Sun, Oct 12, 7:37 AM
Unknown Object (File)
Fri, Oct 3, 1:34 AM
Unknown Object (File)
Tue, Sep 30, 3:16 AM
Unknown Object (File)
Fri, Sep 26, 4:25 AM
Subscribers

Details

Summary

With removal of dom_dispose method the function boils down to two
meaningful function calls: socantrcvmore() and sbrelease(). The latter is
only relevant for protocols that use generic socket buffers.

The socket I/O sx(9) lock acquisition in sorflush() is not relevant for
shutdown(2) operation as it doesn't do any I/O that may interleave with
read(2) or write(2). The socket buffer mutex acquisition inside
sbrelease() is what guarantees thread safety. This sx(9) acquisition in
soshutdown() can be tracked down to 4.4BSD times, where it used to be
sblock(), and it was carried over through the years evolving together with
sockets with no reconsideration of why do we carry it over. I can't tell
if that sblock() made sense back then, but it doesn't make any today.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable