NFS - Fix remaining VM/BIO issues
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 28 Aug 2009 16:47:44 +0000 (09:47 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 28 Aug 2009 17:53:35 +0000 (10:53 -0700)
commita63246d16b71ec43a2effedf45c2602629c764fd
treedf6cd5df151f897e85a7ef87c0ab7a738a75aff1
parentbd81e5e73d14254673bd80356f111f7719aa2d75
NFS - Fix remaining VM/BIO issues

The only bug that could not be resolved by the previous commit is related
to the use of dynamic buffer sizing for the buffer that straddles the
EOF of the file.  For example, if a file is 32768+4127 bytes then the
second buffer cache buffer would have a size of 4127 bytes instead of
32768 bytes.  Because the EOF point can move around and NFS does not
keep good track of it buffers with weird sizes could build up in the
system and interfere with operations against backing VM pages.

In particular truncations followed by seek-write extensions would
interfere with mmap()'s areas around the original (now non-applicable)
truncation point.

It was not possible to fix this bug while still keeping the dynamic
buffer sizing, so this patch converts NFS's buffer cache operations
to use fixed-sized buffers in all cases.  This leads to more wasted
memory when dealing with small files and further optimizations may be
attempted in the future, but it seems to solve issues with BIO/VM
interactions.

* Fsx now survives an overnight pass.

* Buildworld now survives multiple passes when using a writable NFS /usr/obj.

* Fix umount sequencing.  Sometimes the rxthread would get into a
  reconnect loop and not exit.
sys/vfs/nfs/nfs.h
sys/vfs/nfs/nfs_bio.c
sys/vfs/nfs/nfs_iod.c
sys/vfs/nfs/nfs_socket.c
sys/vfs/nfs/nfs_vnops.c
sys/vfs/nfs/nfsnode.h