CVSROOT:        /cvs
Module name:    src
Changes by:     m...@cvs.openbsd.org    2025/01/04 08:57:02

Modified files:
        sys/kern       : uipc_socket.c 
        sys/netinet    : tcp_usrreq.c 

Log message:
Relax sockets splicing locking.

Sockets splicing works around sockets buffers which have their own locks
for all socket types, especially sblock() on `so_snd' which keeps
sockets being spliced.

- sosplice() does read-only sockets options and state checks, the only
modification is `so_sp' assignment. The SB_SPLICE bit modification,
`ssp_socket' and `ssp_soback' assignment protected with `sb_mtx'
mutex(9). PCB layer does corresponding checks with `sb_mtx' held, so
shared solock() is pretty enough in sosplice() path. Introduce
special sosplice_solock_pair() for that purpose.

- sounsplice() requires shared socket lock only around so{r,w}wakeup
calls.

- Push exclusive solock() down to tcp(4) case of somove(). Such sockets
are not ready do unlocked somove() yet.

ok bluhm

Reply via email to