NFS - Rewrite the RTT code and the request flags & low level state machine
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 18 Jul 2009 01:25:05 +0000 (18:25 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 18 Jul 2009 01:25:05 +0000 (18:25 -0700)
commitf8565b0fd3905ebd9fb24ff83243c0b4cb3c0ea9
tree320fa2e348e84d507730c3ed944b6ebaf8f213c3
parent09b62fa43dde6349fdba68f41492ca4ae35f5a5a
NFS - Rewrite the RTT code and the request flags & low level state machine

* The RTT code basically did not work with UDP, and never has very well.
  Use a somewhat different algorithm and make more of an assumption that
  the network is either reliable, or if it isn't reliable that the sysad
  is using a reliable protocol (such as TCP).

  The new RTT code should do a better job, though there will still
  be significant stalling on a lossy network if using UDP (too bad!).

* Replace the congestion control code.  Instead of trying to defer
  packet transmission to the nfs_timer, which we no longer run at
  insane rates, we instead limit the number of async BIOs we allow
  to be queued at any given moment.

* Redo the req->r_flags flags and the low level RPC interlocks between
  the various consumers and producers.  Add additional flags that
  can be tested in assertions to validate expectations.

  Use R_LOCKED for more then just the nfs_timer code.

* Close a memory hole.

* Hold critical sections to close races that could result in a
  thread deadlocking in soreceive waiting for a reply that another
  thread already processed.

* Add two sysctls to aid in testing.

    vfs.nfs.showrexmit - Causes "X" to be printed on the console whenever
  NFS feels that it must retransmit a RPC.  Only
  occurs with UDP mounts.

    vfs.nfs.showrtt - Causes NFS to print out the SRTT, SDRTT, and
  converted timeout calculation once a second
  while NFS requests are active.

* Increase the asynchronous BIO limits.  Because we only need two helper
  threads and no longer depend on dozens of synchronous-rpc threads
  (the old nfsiod's), there is no practical limit to the number of
  requests we can have active.

  Reformulate how asynchronous BIOs are accounted for.  They are now
  accounted for from the moment they are queued to the very end where
  they are biodone()'d.
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_vfsops.c
sys/vfs/nfs/nfsm_subs.c
sys/vfs/nfs/nfsm_subs.h
sys/vfs/nfs/nfsmount.h