cvs commit: src/sys/sys _mutex.h src/sys/kern kern_mutex.c

Robert Watson rwatson at FreeBSD.org
Sat Jan 24 17:59:28 PST 2004


rwatson     2004/01/24 17:59:27 PST

  FreeBSD src repository

  Modified files:
    sys/sys              _mutex.h 
    sys/kern             kern_mutex.c 
  Log:
  Add some basic support for measuring sleep mutex contention to the
  mutex profiling code.  As with existing mutex profiling, measurement
  is done with respect to mtx_lock() instances in the code, as opposed
  to specific mutexes.  In particular, measure two things:
  
  (1) Lock contention.  How often did this mtx_lock() call get made and
      have to sleep (or almost sleep) waiting for the lock.  This helps
      identify the "victims" of contention.
  
  (2) Hold contention.  How often, while the lock was held by a thread
      as a result of this mtx_lock(), did another thread try to acquire
      the same mutex.  This helps identify the causes of contention.
  
  I'm currently exploring adding measurement of "time waited for the
  lock", but the current implementation has proven useful to me so far
  so I figured I'd commit it so others could try it out.  Note that this
  increases the size of mutexes when MUTEX_PROFILING is enabled, so you
  might find you need to further bump UMA_BOOT_PAGES.  Fixes welcome.
  
  The once over:  des, others
  
  Revision  Changes    Path
  1.134     +33 -5     src/sys/kern/kern_mutex.c
  1.11      +9 -0      src/sys/sys/_mutex.h


More information about the cvs-all mailing list