kernel - revamp cluster_read API and improve performance
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 16 Aug 2010 00:20:48 +0000 (17:20 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 16 Aug 2010 00:20:48 +0000 (17:20 -0700)
commit364c022c7c967c27285b70d069fc14df03ffe267
tree1ab07266b13a2065dd8d778bba69efd110960ed4
parent9445671387b788ef06f771527442c59cffae71e8
kernel - revamp cluster_read API and improve performance

* Revamp the API to be much less confusing.  Pass a minimum read ahead
  based on the higher level uio length, and a maximum read ahead
  based on the sequential heuristic.  These combine together to determine
  how much read-ahead to do.

  For example if a program is doing random-reads with 1MB read() requests
  the minreq will take precedence, whereas if the program is doing
  sequential-reads of 8K the maxreq will take precedence.

  The sequential heuristic currently maxes out at 128 * 16384 = 2MB.

* Introduce sysctl vfs.max_readahead instead of hardwiring the maximum
  read-ahead.  This defaults to 2MB which is big enough for just about
  anything.  Generally speaking this value should be larger than
  your stripe width.

  Note that currently the sequential heuristic also maxes out at 2MB so
  you cannot go larger than 2MB.

* Also correct bugs that existed in the old cluster_read(), dramatically
  improving performance on striped volumes with large chunk sizes (128K+)
  and a large number of drives (3+).

* No change here but note that HAMMER will currently issue a minimum of
  64K worth of read-ahead when accessing meta-data.
sys/kern/vfs_cluster.c
sys/sys/buf.h
sys/vfs/gnu/ext2fs/ext2_readwrite.c
sys/vfs/hammer/hammer_io.c
sys/vfs/hammer/hammer_vnops.c
sys/vfs/isofs/cd9660/cd9660_vnops.c
sys/vfs/ufs/ffs_balloc.c
sys/vfs/ufs/ffs_subr.c