[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-server-cvs
Subject:    [Server-cvs] engine/context imutex.cpp,1.2,1.3
From:       dcollins () helixcommunity ! org
Date:       2011-07-09 17:17:49
Message-ID: 201107091717.p69HHsHx019307 () mailer ! progressive-comp ! com
[Download RAW message or body]

Update of /cvsroot/server/engine/context
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv10024/server/engine/context

Modified Files:
	imutex.cpp 
Log Message:
Synopsis
========
Implements a HXMutexLock default behavior change

Branches: HEAD
Reviewer: Chytanya


Description
===========

The default behavior of HXMutexLock() is to do a tight spinloop unless
the caller explicitly tells it otherwise.  This behavior is detrimental to
scalability and performance, particularly with modern multi-core/multi-cpu
systems.

The default is only changed when the HELIX_FEATURE_HXMUTEX_DELAY feature
flag is defined.  This flag was added for all builds.  (Although this
was originally server-specific code, I don't know who all uses it these
days so I didn't feel comfortable changing the default for everyone.)

Most places in the server where these locks are used were already passing
in the delay flag.  However, the server's SharedMemory subsystem and the
IMutex class used by BCNG and the Proxy Cache, were not setting the flag.

Only the first part of the hxmutexlock.h diff is the change.  The rest
is simply removing some highly-obsolete AIX-specific cruft.

Additionally, the IMutex class was updated to pass in the delay flag
as TRUE.  While technically redundant, this provides an additional fix
in case we decide later to experiment with different mutex settings.


Files Affected
==============

common/include/hxmutexlock.h
server/engine/context/imutex.cpp
umakepf/helix-server-all-defines.pf
umakepf/helix-server-nodist.pf
umakepf/helix-server-plus.pf
umakepf/helix-server-restricted.pf


Testing Performed
=================

Unit Tests:
- N/A

Integration Tests:
- Tested with Sun Studio Profiler on Solaris
- Tested in uptimes on Unix platforms

Leak Tests:
- N/A

Performance Tests:
- Load tests showed the CPU load and mutex contention were reduced
- Profiling showed the code was noticably more efficient

Platforms Tested: sunos-5.10-sparc64, linux-rhel5-x86_64
Builds Verified: sunos-5.10-sparc64, linux-rhel5-x86_64, win-x86_64-vc10

QA Hints
========
- N/A



Index: imutex.cpp
===================================================================
RCS file: /cvsroot/server/engine/context/imutex.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- imutex.cpp	23 Jan 2003 23:42:53 -0000	1.2
+++ imutex.cpp	9 Jul 2011 17:17:47 -0000	1.3
@@ -53,14 +53,7 @@
 STDMETHODIMP
 Mutex::Lock()
 {
-#ifdef _AIX
-    //AIX was HB failing without the bWait=TRUE flag:
     HXMutexLock(m_Mutex, TRUE);
-#else
-    //XXXDC this is temporary, we should not be doing tight non-delaying
-    // spinlocks here!  FIXME for 9.01!
-    HXMutexLock(m_Mutex);
-#endif
 
     return HXR_OK;
 }


_______________________________________________
Server-cvs mailing list
Server-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/server-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic