CVSROOT: /cvs Module name: src Changes by: m...@cvs.openbsd.org 2024/05/17 13:11:14
Modified files: sys/kern : uipc_socket.c uipc_socket2.c sys/sys : socketvar.h Log message: Turn sblock() to `sb_lock' rwlock(9) wrapper for all sockets. Unify behaviour to all sockets. Now sblock() should be always taken before solock() in all involved paths as sosend(), soreceive(), sorflush() and sosplice(). sblock() is fine-grained lock which serializes socket send and receive routines on `so_rcv' or `so_snd' buffers. There is no big problem to wait netlock while holding sblock(). This unification removes a lot of temporary "sb_flags & SB_MTXLOCK" code from sockets layer. This unification makes straight "solock()" and "sblock()" lock order, no more solock() -> sblock() -> sounlock() -> solock() -> sbunlock() -> sounlock() chains in sosend() and soreceive() paths. This unification brings witness(4) support for sblock(), include NFS involved sockets, which is useful. Since the witness(4) support was introduced to sblock() with this diff, some new witness reports appeared. bulk(1) tests by tb, ok bluhm