diff options
author | Keith Bostic <keith@wiredtiger.com> | 2013-12-19 09:27:55 -0500 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2013-12-19 09:27:55 -0500 |
commit | ee597c75a8775256cc74ea88c0443466d60a701f (patch) | |
tree | bec5df017b0f4a8103c90b063f4970ac77d6729c /src/include/mutex.i | |
parent | 81712727554528655b031a4931dc6557013ca09f (diff) | |
download | mongo-ee597c75a8775256cc74ea88c0443466d60a701f.tar.gz |
Rework the pthread spinlock logging code.
Split the registry of the spinlock and the registry of a calling
location, they're really completely separate structures, they just
happen to be used for similar purposes
LSM can open a lot of files, increase the number of spinlocks we can
track to 1024, and the maximum spinlock caller location ID's to 60.
Aggregate the block manager and btree page spinlock information, LSM
with bloom filters can open a lot of files.
Diffstat (limited to 'src/include/mutex.i')
-rw-r--r-- | src/include/mutex.i | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/include/mutex.i b/src/include/mutex.i index be1fcd71d17..cccd1245fb9 100644 --- a/src/include/mutex.i +++ b/src/include/mutex.i @@ -92,6 +92,10 @@ __wt_spin_init(WT_SESSION_IMPL *session, WT_SPINLOCK *t, const char *name) t->name = name; t->initialized = 1; +#if SPINLOCK_TYPE == SPINLOCK_PTHREAD_MUTEX_LOGGING + WT_RET(__wt_spin_lock_register_lock(session, t)); +#endif + WT_UNUSED(session); return (0); } @@ -101,10 +105,10 @@ __wt_spin_destroy(WT_SESSION_IMPL *session, WT_SPINLOCK *t) { WT_UNUSED(session); - if (t->initialized) { #if SPINLOCK_TYPE == SPINLOCK_PTHREAD_MUTEX_LOGGING - __wt_spin_lock_unregister(session, t); + __wt_spin_lock_unregister_lock(session, t); #endif + if (t->initialized) { (void)pthread_mutex_destroy(&t->lock); t->initialized = 0; } @@ -172,7 +176,8 @@ __wt_spin_trylock_func(WT_SESSION_IMPL *session, */ if (*idp == WT_SPINLOCK_REGISTER || conn->spinlock_block[*idp].name == NULL) - __wt_spin_lock_register(session, t, file, line, idp); + WT_RET(__wt_spin_lock_register_caller( + session, t->name, file, line, idp)); /* * Try to acquire the mutex: on failure, update blocking statistics, on |