Page MenuHomeFreeBSD

sockets: retire sorflush()
ClosedPublic

Authored by glebius on Jan 12 2024, 10:08 AM.
Tags
None
Referenced Files
F87205929: D43415.id132667.diff
Sun, Jun 30, 6:21 AM
Unknown Object (File)
May 15 2024, 9:16 PM
Unknown Object (File)
Apr 12 2024, 10:27 AM
Unknown Object (File)
Apr 7 2024, 12:28 AM
Unknown Object (File)
Feb 20 2024, 9:05 AM
Unknown Object (File)
Jan 31 2024, 11:42 AM
Unknown Object (File)
Jan 19 2024, 12:33 PM
Unknown Object (File)
Jan 19 2024, 12:29 PM
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