git: hammer2 - Multitude of SMP contention fixes, work on flush

Matthew Dillon dillon at crater.dragonflybsd.org
Thu Oct 19 19:03:05 PDT 2023


commit 34fb48c236fd17fbe558c7b2cf21b4e50f38153e
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Thu Oct 19 18:54:00 2023 -0700

    hammer2 - Multitude of SMP contention fixes, work on flush
    
    * Change the hammer2_io RBTREE to a hash table with per-entry locks.
      This reduces contention in the hammer2 block I/O subsystem which
      used to be protected by a single lock.
    
    * Change the hammer2_inode RBTREE to a hash table with per-entry locks.
      This reduces contention in the hammer2 inode cache which used to be
      protected by a single lock.
    
    * Replace the hammer2_chain LRU cache with a per-inode cluster cache,
      which caches the last cluster-related chain.  These caches are designed
      to hold a deep chain with 0 refs (and thus its parent recursion) to
      avoid having to reconstitute and recheck the chains on every VOP.  For
      example when doing sequential I/O on a file.
    
      Probably needs more work.
    
    * Use the new trigger_syncer_start() and trigger_syncer_end() API
      to fix flush waits when the frontend is be asked to do large bulk
      modifying operations (such as file creation).
    
      The old code still worked but could sometimes cause processes to pause
      for up to 30 seconds when the flush wait raced the syncer.  The flush
      wait wound up waiting for the next filesystem sync.

Summary of changes:
 sys/vfs/hammer2/hammer2.h        |  56 ++++---
 sys/vfs/hammer2/hammer2_admin.c  |  50 ++++++-
 sys/vfs/hammer2/hammer2_chain.c  | 199 +------------------------
 sys/vfs/hammer2/hammer2_flush.c  |   4 +-
 sys/vfs/hammer2/hammer2_inode.c  | 135 +++++++++++++----
 sys/vfs/hammer2/hammer2_io.c     | 314 ++++++++++++++++++++++++---------------
 sys/vfs/hammer2/hammer2_ioctl.c  |   4 +-
 sys/vfs/hammer2/hammer2_vfsops.c |  63 ++++----
 8 files changed, 419 insertions(+), 406 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/34fb48c236fd17fbe558c7b2cf21b4e50f38153e


-- 
DragonFly BSD source repository


More information about the Commits mailing list