diff options
| author | 2017-03-03 09:41:20 +0000 | |
|---|---|---|
| committer | 2017-03-03 09:41:20 +0000 | |
| commit | c93bdfa37b16b2ae363ba9b488f93c710d13a095 (patch) | |
| tree | efff4dc45c7dcf1f615929e1c80b13633bafa5a0 /sys/nfs/nfs_socket.c | |
| parent | Undefined behavior: Variable 'user' was used as parameter and (diff) | |
| download | wireguard-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/nfs/nfs_socket.c')
| -rw-r--r-- | sys/nfs/nfs_socket.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c index 4abf85c41cf..c562aae7327 100644 --- a/sys/nfs/nfs_socket.c +++ b/sys/nfs/nfs_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_socket.c,v 1.113 2017/02/22 11:42:46 mpi Exp $ */ +/* $OpenBSD: nfs_socket.c,v 1.114 2017/03/03 09:41:20 mpi Exp $ */ /* $NetBSD: nfs_socket.c,v 1.27 1996/04/15 20:20:00 thorpej Exp $ */ /* @@ -1580,27 +1580,16 @@ nfsrv_rcv(struct socket *so, caddr_t arg, int waitflag) if ((slp->ns_flag & SLP_VALID) == 0) return; -#ifdef notdef - /* - * Define this to test for nfsds handling this under heavy load. - */ + + /* Defer soreceive() to an nfsd. */ if (waitflag == M_DONTWAIT) { - slp->ns_flag |= SLP_NEEDQ; goto dorecs; + slp->ns_flag |= SLP_NEEDQ; + goto dorecs; } -#endif + auio.uio_procp = NULL; if (so->so_type == SOCK_STREAM) { /* - * If there are already records on the queue, defer soreceive() - * to an nfsd so that there is feedback to the TCP layer that - * the nfs servers are heavily loaded. - */ - if (slp->ns_rec && waitflag == M_DONTWAIT) { - slp->ns_flag |= SLP_NEEDQ; - goto dorecs; - } - - /* * Do soreceive(). */ auio.uio_resid = 1000000000; |
