On Mon, Nov 22, 2021 at 03:13:44PM +0300, Vitaliy Makkoveev wrote:
> Since the rev1.267 of kern/uipc_socket solock() is used as klist lock
> for sockets to make socket event filters MP-safe. This means KNOTE(9)
> within doaccept() doesn't require kernel lock to be held and the
> accept(2) and accept4(2) syscalls could be unlocked. This makes sense
> because all our sockets use rwlock(9)s for protection. This also makes
> sense for the next step of unix(4) sockets unlocking.
> 
> The sys_accept() and sys_accept4() are just wrappers around doaccept()
> which does all the work and there is no differences within so they could
> be unlocked together.
> 
> I also tested this diff with all incarnation of "Rework UNIX sockets
> locking to be fine grained" diff [1].
> 
> ok?

regress passes on i386 and amd64.  OK bluhm@

> 
> 1.https://marc.info/?l=openbsd-tech&m=163758154427455&w=2
> 
> Index: sys/kern/syscalls.master
> ===================================================================
> RCS file: /cvs/src/sys/kern/syscalls.master,v
> retrieving revision 1.219
> diff -u -p -r1.219 syscalls.master
> --- sys/kern/syscalls.master  27 Oct 2021 03:24:44 -0000      1.219
> +++ sys/kern/syscalls.master  22 Nov 2021 11:51:33 -0000
> @@ -95,7 +95,7 @@
>  29   STD NOLOCK      { ssize_t sys_recvfrom(int s, void *buf, size_t len, \
>                           int flags, struct sockaddr *from, \
>                           socklen_t *fromlenaddr); }
> -30   STD             { int sys_accept(int s, struct sockaddr *name, \
> +30   STD NOLOCK      { int sys_accept(int s, struct sockaddr *name, \
>                           socklen_t *anamelen); }
>  31   STD             { int sys_getpeername(int fdes, struct sockaddr *asa, \
>                           socklen_t *alen); }
> @@ -204,7 +204,7 @@
>  91   STD NOLOCK      { int sys_nanosleep(const struct timespec *rqtp, \
>                           struct timespec *rmtp); }
>  92   STD NOLOCK      { int sys_fcntl(int fd, int cmd, ... void *arg); }
> -93   STD             { int sys_accept4(int s, struct sockaddr *name, \
> +93   STD NOLOCK      { int sys_accept4(int s, struct sockaddr *name, \
>                           socklen_t *anamelen, int flags); }
>  94   STD NOLOCK      { int sys___thrsleep(const volatile void *ident, \
>                           clockid_t clock_id, const struct timespec *tp, \

Reply via email to