network - Tokenize NFS, fix MP races
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 10 Sep 2010 19:09:34 +0000 (12:09 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 10 Sep 2010 19:09:34 +0000 (12:09 -0700)
commitc6b43e93a6cf0a70bde32cd141057a0df9860e13
tree9572d137aa6472e5ae4e041694959db85d046199
parent81db6b67a45f6f372ebe389a3bbd49e1117122f0
network - Tokenize NFS, fix MP races

* Now that the rest of the network stack is running MPSAFE, poor NFS is
  hitting races and other issues because it was depending on the MP lock.

* Recombobulate NFS with tokens, protecting all border crossings:

  A global nfs_token is used for the nfs mount list, nfsd list, and
  server socket list.

  A per-socket token (nfssvc_sock->ns_token) governs each served mount.

  A per-mount token (nfsmount->nm_token) governs each client mount.

* Callouts and TCP upcalls are protected.  The per-socket TCP upcall
  is protected by the nfssvc_sock token.

* The NFS iod thread pairs and nfsd threads now run MPSAFE.

* NFSv3 is now holy-shit fast and can trivially max-out a GigE link
  without TSO when the server is not otherwise limited by server-side
  disks.
sys/vfs/nfs/nfs.h
sys/vfs/nfs/nfs_bio.c
sys/vfs/nfs/nfs_iod.c
sys/vfs/nfs/nfs_node.c
sys/vfs/nfs/nfs_socket.c
sys/vfs/nfs/nfs_subs.c
sys/vfs/nfs/nfs_syscalls.c
sys/vfs/nfs/nfs_vfsops.c
sys/vfs/nfs/nfs_vnops.c
sys/vfs/nfs/nfsmount.h