HAMMER 56B/Many: Performance tuning - MEDIA STRUCTURES CHANGED!
authorMatthew Dillon <dillon@dragonflybsd.org>
Wed, 18 Jun 2008 01:13:30 +0000 (01:13 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Wed, 18 Jun 2008 01:13:30 +0000 (01:13 +0000)
commitbcac4bbbd5f3273e9992610b0eb080dac518985a
tree65f1564ecadcb91b7111ee54246e515109d79152
parente71a125f8b30bacf604ea6596b97950d9d3175e1
HAMMER 56B/Many: Performance tuning - MEDIA STRUCTURES CHANGED!

* MEDIA CHANGE: The atime has been moved back into the inode data proper.
  The nlinks field has also been moved.

* PERFORMANCE: The CRC for cached B-Tree nodes was being run on every access
  instead of just the first time.  This was the cause of HAMMER's poor
  directory scanning performance and cpu-intensive write flushes.

  Adjusted to only check the CRC on the initial load into the buffer cache.

* PERFORMANCE: The CRC for modified B-Tree nodes was being regenerated every
  time the node was modified, so a large number of insertions or deletions
  modifying the same B-Tree need needlessly regenerated the CRC each time.

  Adjusted to delay generation of the CRC until just before the buffer is
  flushed to the physical media.

  Just for the record, B-Tree nodes are 4K and it takes ~25uS to run a CRC
  on them.  Needless to say removing the unnecessary calls solved a lot of
  performance issues.

* PERFORMANCE: Removed limitations in the node caching algorithms.  Now more
  then one inode can cache pointers to the same B-Tree node.

* PERFORMANCE: When calculating the parent B-Tree node we have to scan the
  element array to locate the index that points back to the child.  Use a
  power-of-2 algorithm instead of a linear scan.

* PERFORMANCE: Clean up the selection of ip->cache[0] or ip->cache[1] based
  on whether we are trying to cache the location of the inode or the
  location of the file object's data.
12 files changed:
sys/vfs/hammer/hammer.h
sys/vfs/hammer/hammer_btree.c
sys/vfs/hammer/hammer_btree.h
sys/vfs/hammer/hammer_cursor.c
sys/vfs/hammer/hammer_disk.h
sys/vfs/hammer/hammer_inode.c
sys/vfs/hammer/hammer_io.c
sys/vfs/hammer/hammer_object.c
sys/vfs/hammer/hammer_ondisk.c
sys/vfs/hammer/hammer_transaction.c
sys/vfs/hammer/hammer_vfsops.c
sys/vfs/hammer/hammer_vnops.c