summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_socket.c
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2017-03-03 09:41:20 +0000
committermpi <mpi@openbsd.org>2017-03-03 09:41:20 +0000
commitc93bdfa37b16b2ae363ba9b488f93c710d13a095 (patch)
treeefff4dc45c7dcf1f615929e1c80b13633bafa5a0 /sys/kern/uipc_socket.c
parentUndefined behavior: Variable 'user' was used as parameter and (diff)
downloadwireguard-openbsd-c93bdfa37b16b2ae363ba9b488f93c710d13a095.tar.xz
wireguard-openbsd-c93bdfa37b16b2ae363ba9b488f93c710d13a095.zip
Prevent a recursion in the socket layer.
Always defere soreceive() to an nfsd(8) process instead of doing it in the 'softnet' thread. Avoiding this recursion ensure that we do not introduce a new sleeping point by releasing and grabbing the netlock. Tested by many, committing now in order to find possible performance regression.
Diffstat (limited to 'sys/kern/uipc_socket.c')
-rw-r--r--sys/kern/uipc_socket.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index a12d868e2cd..1affe913afc 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket.c,v 1.177 2017/02/14 09:46:21 mpi Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.178 2017/03/03 09:41:20 mpi Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
@@ -1529,12 +1529,8 @@ sorwakeup(struct socket *so)
return;
#endif
sowakeup(so, &so->so_rcv);
- if (so->so_upcall) {
- /* XXXSMP breaks atomicity */
- rw_exit_write(&netlock);
+ if (so->so_upcall)
(*(so->so_upcall))(so, so->so_upcallarg, M_DONTWAIT);
- rw_enter_write(&netlock);
- }
}
void