summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2017-03-03 09:41:21 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2017-03-03 09:41:21 +0000
commiteba2d629bf403623d0bc5636350e9d78f049e8b0 (patch)
treeedfab56d41f61aa0f810f06fb86276f9fd2f2098 /sys/kern
parentfd55d4d03b161daa8ece6c47929caa2f0e77eb6e (diff)
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')
-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