HomeFreeBSD

sockets: remove the socket-on-stack hack from sorflush()

Description

sockets: remove the socket-on-stack hack from sorflush()

The hack can be tracked down to 4.4BSD, where copy was performed
under splimp() and then after splx() dom_dispose was called.
Stevens has a chapter on this function, but he doesn't answer why
this trick is necessary. Why can't we call into dom_dispose under
splimp()? Anyway, with multithreaded kernel the hack seems to be
necessary to avoid LORs between socket buffer lock and different
filesystem locks, especially network file systems.

The new socket buffers KPI sbcut() from 1d2df300e9b allow us to get
rid of the hack.

Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D35125

Details

Provenance
glebiusAuthored on May 9 2022, 5:43 PM
Reviewer
markj
Differential Revision
D35125: sockets: remove the socket-on-stack hack from sorflush()
Parents
rG42f2fa9953da: sockets: don't call dom_dispose() on a listening socket
Branches
Unknown
Tags
Unknown