summaryrefslogtreecommitdiffstats
path: root/sys/sys/lock_profile.h
Commit message (Collapse)AuthorAgeFilesLines
* In non-debugging mode make this define (void)0 instead of nothing. Thisrdivacky2009-06-211-4/+4
| | | | | | | | | | helps to catch bugs like the below with clang. if (cond); <--- note the trailing ; something(); Approved by: ed (mentor) Discussed on: current@
* - Implement a new mechanism for resetting lock profiling. We nowjeff2009-03-151-16/+7
| | | | | | | | | | | | | | | | | guarantee that all cpus have acknowledged the cleared enable int by scheduling the resetting thread on each cpu in succession. Since all lock profiling happens within a critical section this guarantees that all cpus have left lock profiling before we clear the datastructures. - Assert that the per-thread queue of locks lock profiling is aware of is clear on thread exit. There were several cases where this was not true that slows lock profiling and leaks information. - Remove all objects from all lists before clearing any per-cpu information in reset. Lock profiling objects can migrate between per-cpu caches and previously these migrated objects could be zero'd before they'd been removed Discussed with: attilio Sponsored by: Nokia
* Fix tinderbox on sun4vkmacy2007-12-161-0/+1
| | | | include cpufunc.h so that nanoseconds(void) is defined
* - Define lpohead even if userspace includes this file.jeff2007-12-161-2/+1
|
* - Re-implement lock profiling in such a way that it no longer breaksjeff2007-12-151-112/+27
| | | | | | | | | | | | | | | | | | | | | | the ABI when enabled. There is no longer an embedded lock_profile_object in each lock. Instead a list of lock_profile_objects is kept per-thread for each lock it may own. The cnt_hold statistic is now always 0 to facilitate this. - Support shared locking by tracking individual lock instances and statistics in the per-thread per-instance lock_profile_object. - Make the lock profiling hash table a per-cpu singly linked list with a per-cpu static lock_prof allocator. This removes the need for an array of spinlocks and reduces cache contention between cores. - Use a seperate hash for spinlocks and other locks so that only a critical_enter() is required and not a spinlock_enter() to modify the per-cpu tables. - Count time spent spinning in the lock statistics. - Remove the LOCK_PROFILE_SHARED option as it is always supported now. - Specifically drop and release the scheduler locks in both schedulers since we track owners now. In collaboration with: Kip Macy Sponsored by: Nokia
* Currently the LO_NOPROFILE flag (which is masked on upper level code byattilio2007-09-141-3/+5
| | | | | | | | | | | | | | | | | | per-primitive macros like MTX_NOPROFILE, SX_NOPROFILE or RW_NOPROFILE) is not really honoured. In particular lock_profile_obtain_lock_failure() and lock_profile_obtain_lock_success() are naked respect this flag. The bug leads to locks marked with no-profiling to be profiled as well. In the case of the clock_lock, used by the timer i8254 this leads to unpredictable behaviour both on amd64 and ia32 (double faults panic, sudden reboots, etc.). The amd64 clock_lock is also not marked as not profilable as it should be. Fix these bugs adding proper checks in the lock profiling code and at clock_lock initialization time. i8254 bug pointed out by: kris Tested by: matteo, Giuseppe Cocomazzi <sbudella at libero dot it> Approved by: jeff (mentor) Approved by: re
* Fix userland applications compilation by using correct KPI protectionattilio2007-07-111-0/+7
| | | | | | | | | macros for lock_profiling. Reported by: Tom McLaughlin <tmclaugh@sdf.lonestar.org> Tested by: Tom McLaughlin <tmclaugh@sdf.lonestar.org> Approved by: jeff (mentor) Approved by: re
* Don't set lo_name and clobber lo_flags in lock_profile_object_init().jhb2007-05-231-2/+0
| | | | | | | | | This was just wasteful when this was always called before lock_init() (which overwrote both fields each time), but when lock_profile_object_init() was moved into lock_init() the clearing of lo_flags proved fatal (all locks became spin locks to _sleep(), etc.) Reported by: kris
* skip call to _lock_profile_obtain_lock_success entirely if acquisition time ↵kmacy2007-04-031-2/+4
| | | | | | is non-zero (i.e. recursing or adding sharers)
* Remove unneccessary LO_CONTESTED flagkmacy2007-04-031-9/+6
|
* Further improvements to LOCK_PROFILING:kmacy2007-02-271-1/+8
| | | | | | | | | | | | - Fix missing initialization in kern_rwlock.c causing bogus times to be collected - Move updates to the lock hash to after the lock is released for spin mutexes, sleep mutexes, and sx locks - Add new kernel build option LOCK_PROFILE_FAST - only update lock profiling statistics when an acquisition is contended. This reduces the overhead of LOCK_PROFILING to increasing system time by 20%-25% which on "make -j8 kernel-toolchain" on a dual woodcrest is unmeasurable in terms of wall-clock time. Contrast this to enabling lock profiling without LOCK_PROFILE_FAST and I see a 5x-6x slowdown in wall-clock time.
* general LOCK_PROFILING cleanupkmacy2007-02-261-32/+11
| | | | | | | | | | | | - only collect timestamps when a lock is contested - this reduces the overhead of collecting profiles from 20x to 5x - remove unused function from subr_lock.c - generalize cnt_hold and cnt_lock statistics to be kept for all locks - NOTE: rwlock profiling generates invalid statistics (and most likely always has) someone familiar with that should review
* - Fix some gcc warnings in lock_profile.hkmacy2006-12-161-18/+16
| | | | | | | - add cnt_hold cnt_lock support for spin mutexes - make sure contested is initialized to zero to only bump contested when appropriate - move initialization function to kern_mutex.c to avoid cyclic dependency between mutex.h and lock_profile.h
* Add Kris Kennaway to reflect his performance improvements tokmacy2006-11-141-0/+1
| | | | the lock profiling code
* track lock class name in a way that doesn't break WITNESSkmacy2006-11-131-2/+3
|
* GRRRRR - missed this in the last commitkmacy2006-11-121-0/+1
|
* fix messup in last fixkmacy2006-11-111-0/+1
|
* declare nanoseconds for other architectureskmacy2006-11-111-0/+4
|
* remove lingering call to rd(tick)kmacy2006-11-111-1/+2
|
* MUTEX_PROFILING has been generalized to LOCK_PROFILING. We now profilekmacy2006-11-111-0/+170
wait (time waited to acquire) and hold times for *all* kernel locks. If the architecture has a system synchronized TSC, the profiling code will use that - thereby minimizing profiling overhead. Large chunks of profiling code have been moved out of line, the overhead measured on the T1 for when it is compiled in but not enabled is < 1%. Approved by: scottl (standing in for mentor rwatson) Reviewed by: des and jhb
OpenPOWER on IntegriCloud