hammer2 - Integrate CCMS thread lock into hammer2 chain structure
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 8 Jun 2012 06:52:01 +0000 (23:52 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 8 Jun 2012 06:52:01 +0000 (23:52 -0700)
commita0ed3c24c92cd8616cf55e46d1776cd2373acb71
tree9928dc4bc4c6417e39e68196a496983a0d0b261b
parent8d0123f0e071b245ccaa78862dd3a8335416b6ad
hammer2 - Integrate CCMS thread lock into hammer2 chain structure

* Integrate the CCMS thread lock into the hammer2 chain structure.

* Implement shared and exclusive modes (hammer2 was only really using
  exclusive mode before).  Rework all the chain and inode locking functions
  to use CCMS via chain->cst.

  This also required changing the SPLAY trees into RB trees.

* Start reworking non-modifying VNOPS to use shared CCMS locks.

* Rework the hammer2_chain_drop() function to avoid deadlocks due to the
  mixed shared/exclusive locks we now support.

* Major performance improvements for concurrent access.  SHARED locks now
  extend to hammer2_chain and hammer2_inode structural accesses, recursions,
  and cached data (buffer cache) accesses.

  In particular, multiple threads can now access the same bp via a
  hammer2_chain locked shared.  The bp's themselves are still exclusive
  only (the kernel APIs haven't changed), but the hammer2_chain structure
  can now share the bp's data across several threads accessing it via the
  chain.
sys/vfs/hammer2/Makefile
sys/vfs/hammer2/hammer2.h
sys/vfs/hammer2/hammer2_ccms.c
sys/vfs/hammer2/hammer2_ccms.h
sys/vfs/hammer2/hammer2_chain.c
sys/vfs/hammer2/hammer2_inode.c
sys/vfs/hammer2/hammer2_subr.c
sys/vfs/hammer2/hammer2_vfsops.c
sys/vfs/hammer2/hammer2_vnops.c