On Tue, Mar 26, 2024 at 03:46:47AM -0600, Vitaliy Makkoveev wrote: > CVSROOT: /cvs > Module name: src > Changes by: [email protected] 2024/03/26 03:46:47 > > Modified files: > sys/kern : sys_socket.c uipc_socket.c uipc_socket2.c > uipc_usrreq.c > sys/miscfs/fifofs: fifo_vnops.c > sys/sys : socketvar.h > > Log message: > Use `sb_mtx' to protect `so_rcv' receive buffer of unix(4) sockets. > > This makes re-locking unnecessary in the uipc_*send() paths, because > it's enough to lock one socket to prevent peer from concurrent > disconnection. As the little bonus, one unix(4) socket can perform > simultaneous transmission and reception with one exception for > uipc_rcvd(), which still requires the re-lock for connection oriented > sockets. > > The socket lock is not held while filt_soread() and filt_soexcept() > called from uipc_*send() through sorwakeup(). However, the unlocked > access to the `so_options', `so_state' and `so_error' is fine. > > The receiving socket can't be or became listening socket. It also can't > be disconnected concurrently. This makes immutable SO_ACCEPTCONN, > SS_ISDISCONNECTED and SS_ISCONNECTED bits which are clean and set > respectively. > > `so_error' is set on the peer sockets only by unp_detach(), which also > can't be called concurrently on sending socket. > > This is also true for filt_fiforead() and filt_fifoexcept(). For other > callers like kevent(2) or doaccept() the socket lock is still held. > > ok bluhm
Observing two regress hangs in the kernel on netio. Both seems make use of unix sockets. Could this be the culprit? regress/lib/libc/fread regress/usr.bin/ssh (scp.sh)
