From: VMware, Inc <> Date: Tue, 13 Mar 2012 19:58:51 +0000 (-0700) Subject: lib/lock: less checking in non-debug builds X-Git-Tag: 2012.03.13-651368~83 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=54bbb09a33c159fccb0d2eddccc720c2aced4593;p=thirdparty%2Fopen-vm-tools.git lib/lock: less checking in non-debug builds Remove checking from non-debug builds. The original requirements called for checking all the time but this is turning out to be too expensive. Times in NS/Cycles (exclusive lock, uncontended): Before: 44/177 After: 39/103 Signed-off-by: Dmitry Torokhov --- diff --git a/open-vm-tools/lib/lock/ulExcl.c b/open-vm-tools/lib/lock/ulExcl.c index 0ea0e3554..1ca7d9fbd 100644 --- a/open-vm-tools/lib/lock/ulExcl.c +++ b/open-vm-tools/lib/lock/ulExcl.c @@ -425,7 +425,7 @@ MXUser_AcquireExclLock(MXUserExclLock *lock) // IN/OUT: NULL); // non-stats } - if (MXRecLockCount(&lock->recursiveLock) > 1) { + if (vmx86_debug && (MXRecLockCount(&lock->recursiveLock) > 1)) { MXUserDumpAndPanic(&lock->header, "%s: Acquire on an acquired exclusive lock\n", __FUNCTION__); @@ -477,7 +477,7 @@ MXUser_ReleaseExclLock(MXUserExclLock *lock) // IN/OUT: } } - if (!MXRecLockIsOwner(&lock->recursiveLock)) { + if (vmx86_debug && !MXRecLockIsOwner(&lock->recursiveLock)) { uint32 lockCount = MXRecLockCount(&lock->recursiveLock); MXUserDumpAndPanic(&lock->header, diff --git a/open-vm-tools/lib/lock/ulRec.c b/open-vm-tools/lib/lock/ulRec.c index 45523055a..8e75e5002 100644 --- a/open-vm-tools/lib/lock/ulRec.c +++ b/open-vm-tools/lib/lock/ulRec.c @@ -590,7 +590,7 @@ MXUser_ReleaseRecLock(MXUserRecLock *lock) // IN/OUT: } } - if (!MXRecLockIsOwner(&lock->recursiveLock)) { + if (vmx86_debug && !MXRecLockIsOwner(&lock->recursiveLock)) { uint32 lockCount = MXRecLockCount(&lock->recursiveLock); MXUserDumpAndPanic(&lock->header,