HomeFreeBSD

sockets: retire sorflush()

Description

sockets: retire sorflush()

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.

Reviewed by: tuexen
Differential Revision: https://reviews.freebsd.org/D43415

Details

Provenance
glebiusAuthored on Jan 16 2024, 6:26 PM
Reviewer
tuexen
Differential Revision
D43415: sockets: retire sorflush()
Parents
rG289bee16be9c: sockets: remove dom_dispose and PR_RIGHTS
Branches
Unknown
Tags
Unknown
Reverted By
rGce69e37369aa: Revert "sockets: retire sorflush()"