kernel - Improve cluster_read()
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 8 Feb 2010 17:51:05 +0000 (09:51 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 8 Feb 2010 17:51:05 +0000 (09:51 -0800)
commit6b84c93eb3b1e5815f00edf82f94fa12b79a9cc1
treec6724817ee5bfb9763963d490f3d5ea0fae778fa
parente7c0dbbaa9d5a2de52e8882628668615903e9132
kernel - Improve cluster_read()

* The cluster_read() code was tripping over itself due to a findblk()
  call which caused it to believe it had found a buffer hole when it
  really found a busy buffer.

  Redo the code to use the FINDBLK_TEST flag to locate the next buffer
  hole.  Also add a shortcut to support efficient coding for larger
  read-ahead values.

* Change the single-read-ahead in cluster_read() to a multiple-read-ahead
  based on the maxra parameter.  Before we just did a single read-ahead
  and even though this was a cluster read it still created a situation
  where the next cluster_read(0 operation would stall on previous read-ahead
  before issuing the next one.  In otherwords, it wasn't pipelining requests
  as well asit could.

  This change tries to keep at least two read-aheads in progress so when
  the next cluster_read() stalls on the first one the second one is still
  in the pipeline after it unstalls, allowing it to issue the third one
  to keep the pipeline hot.

* These changes improve SSD swapcache operation as well as normal HD
  cluster_read() pipelining.  In addition the read-ahead is now sufficient
  to keep the pipeline hot across a 2 x Swap (interleaved) setup.
sys/kern/vfs_cluster.c