diff options
author | Michael Cahill <michael.cahill@mongodb.com> | 2017-04-04 00:31:05 +1000 |
---|---|---|
committer | Alex Gorrod <alexander.gorrod@mongodb.com> | 2017-04-03 10:31:05 -0400 |
commit | 871889c0b87dcd2560704248eba0a4b119ca26f1 (patch) | |
tree | 4567b6ec235b9be9db5dc9fd48e6d9ba441e3c1f | |
parent | 423f4e11050f7644b1a8d2b6b1cc60c35ef915c8 (diff) | |
download | mongo-871889c0b87dcd2560704248eba0a4b119ca26f1.tar.gz |
WT-3250 Fix spinlock statistics tracking on Windows. (#3363)
MongoDB user on Windows noticed the "LSM: application work units currently queued" statistic was changing in a configuration that involved no LSM code. This was caused by a bug in code that tracks time spent in spinlocks incrementing the wrong statistic.
In particular, spinlocks contain fields describing which statistics should be used to track time spent in that spinlock. A value of -1 indicates that the spinlock should not be tracked, but a value of zero is the first statistic in the array for a connection, which happens to be the "LSM: application work units currently queued" statistic. The Windows implementation of spinlocks was not setting these fields to -1, leading to the bug.
This bug was introduced by WT 2955 and also meant that every WiredTiger spinlock on Windows was being timed, which may have negatively impacted Windows performance.
-rw-r--r-- | src/include/mutex.i | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/include/mutex.i b/src/include/mutex.i index 640706284c3..eb95d76a1a2 100644 --- a/src/include/mutex.i +++ b/src/include/mutex.i @@ -32,7 +32,9 @@ __wt_spin_init(WT_SESSION_IMPL *session, WT_SPINLOCK *t, const char *name) WT_UNUSED(name); t->lock = 0; + t->name = name; t->stat_count_off = t->stat_app_usecs_off = t->stat_int_usecs_off = -1; + t->initialized = 1; return (0); } @@ -196,6 +198,7 @@ __wt_spin_init(WT_SESSION_IMPL *session, WT_SPINLOCK *t, const char *name) } t->name = name; + t->stat_count_off = t->stat_app_usecs_off = t->stat_int_usecs_off = -1; t->initialized = 1; return (0); } |