diff options
author | Jeff Roberson <jeff@FreeBSD.org> | 2007-12-15 23:13:31 +0000 |
---|---|---|
committer | Jeff Roberson <jeff@FreeBSD.org> | 2007-12-15 23:13:31 +0000 |
commit | eea4f254fe8f66e4d58b9befe435010a2d485423 (patch) | |
tree | 5aa1ecb0fadd118191701a2b1c611fcee7216753 /sys/sys/sx.h | |
parent | 4c908c35e08a0203c425a64e93de4d6344fb34fc (diff) | |
download | src-eea4f254fe8f66e4d58b9befe435010a2d485423.tar.gz src-eea4f254fe8f66e4d58b9befe435010a2d485423.zip |
- Re-implement lock profiling in such a way that it no longer breaks
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
Notes
Notes:
svn path=/head/; revision=174629
Diffstat (limited to 'sys/sys/sx.h')
-rw-r--r-- | sys/sys/sx.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/sys/sx.h b/sys/sys/sx.h index 47fdae63c1a7..5df5f36c7ced 100644 --- a/sys/sys/sx.h +++ b/sys/sys/sx.h @@ -178,11 +178,9 @@ __sx_slock(struct sx *sx, int opts, const char *file, int line) if (!(x & SX_LOCK_SHARED) || !atomic_cmpset_acq_ptr(&sx->sx_lock, x, x + SX_ONE_SHARER)) error = _sx_slock_hard(sx, opts, file, line); -#ifdef LOCK_PROFILING_SHARED - else if (SX_SHARERS(x) == 0) + else lock_profile_obtain_lock_success(&sx->lock_object, 0, 0, file, line); -#endif return (error); } |