CVSROOT: /cvs Module name: src Changes by: m...@cvs.openbsd.org 2023/07/04 16:28:24
Modified files: sys/kern : uipc_socket.c uipc_socket2.c sys/sys : socketvar.h Log message: Introduce SBL_WAIT and SBL_NOINTR sbwait() flags. This refactoring is another step to make standalone socket buffers locking. sblock() uses M_WAITOK and M_NOWAIT flags passed as the third argument together with the SB_NOINTR flag on the `sb_flags' to control sleep behaviour. To perform uninterruptible acquisition, SB_NOINTR flag should be set before sblock() call. `sb_flags' modification requires to hold solock() around sblock()/sbunlock() that makes standalone call impossible. Also `sb_flags' modifications outside sblock()/sbunlock() makes uninterruptible acquisition code huge enough. This time only sorflush() does this (and forgets to restore SB_NOINTR flag, so shutdown(SHUT_RDWR) call permanently modifies socket locking behaviour) and this looks not the big problem. But with the standalone socket buffer locking it will be many such places, so this huge construction is unwanted. Introduce new SBL_NOINTR flag passed as third sblock() argument. The sblock() acquisition will be uninterruptible when existing SB_NOINTR flag is set on `sb_flags' or SBL_NOINTR was passed. The M_WAITOK and M_NOWAIT flags belongs to malloc(9). It has no M_NOINTR flag and there is no reason to introduce it. So for consistency reasons introduce new SBL_WAIT and use it together with SBL_NOINTR instead of M_WAITOK and M_NOINTR respectively. ok bluhm