On 06/21/2011 08:25 AM, Jan Friesse wrote:
> Steve,
> patch which removes all spinlocks + spinlock test in configure.ac attached.
> 
> Regards,
>   Honza
> 
> Steven Dake wrote:
>> I think it is better just to remove spinlocks entirely.
>>
>> The only place they may be useful is in logsys and hdb.  Unfortunately
>> hdb and logsys are always used inside a mutex (usually these paths are
>> called by coroipcs or totempg).
>>
>> It is not safe to do:
>> pthread_mutex_lock
>> pthread_spin_lock
>> pthread_spin_unlock
>> pthread_mutex_unlock
>>
>> This is exactly what we are doing and I don't want the user to be able
>> to turn that functionality on.
>>
>> Regards
>> -steve
>>
>>
>> On 06/21/2011 03:55 AM, Jan Friesse wrote:
>>> Spinlocks are now by default disabled, because even spinlock can improve
>>> speed is some special cases, in most cases it makes corosync CPU usage
>>> much more intensive and less responsive then if only mutexes are used.
>>>
>>> Signed-off-by: Jan Friesse <[email protected]>
>>> ---
>>>  configure.ac |   13 ++++++++++---
>>>  1 files changed, 10 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/configure.ac b/configure.ac
>>> index 1fb57cf..499bd07 100644
>>> --- a/configure.ac
>>> +++ b/configure.ac
>>> @@ -115,8 +115,7 @@ AC_FUNC_VPRINTF
>>>  AC_CHECK_FUNCS([alarm alphasort atexit bzero dup2 endgrent endpwent fcntl \
>>>             getcwd getpeerucred getpeereid gettimeofday inet_ntoa memmove \
>>>             memset mkdir scandir select socket strcasecmp strchr strdup \
>>> -           strerror strrchr strspn strstr pthread_spin_lock \
>>> -           pthread_spin_unlock pthread_setschedparam \
>>> +           strerror strrchr strspn strstr pthread_setschedparam \
>>>             sched_get_priority_max sched_setscheduler])
>>>  
>>>  AC_CONFIG_FILES([Makefile
>>> @@ -273,7 +272,6 @@ AC_ARG_ENABLE([augeas],
>>>     [ enable_augeas="no" ])
>>>  AM_CONDITIONAL(INSTALL_AUGEAS, test x$enable_augeas = xyes)
>>>  
>>> -
>>>  AC_ARG_WITH([initddir],
>>>     [  --with-initddir=DIR     : path to init script directory. ],
>>>     [ INITDDIR="$withval" ],
>>> @@ -293,6 +291,10 @@ AC_ARG_ENABLE([snmp],
>>>         [  --enable-snmp           : SNMP protocol support ],
>>>         [ default="no" ])
>>>  
>>> +AC_ARG_ENABLE([spinlocks],
>>> +   [  --enable-spinlocks              : Spinlocks support ],,
>>> +   [ default="no" ])
>>> +
>>>  # OS detection
>>>  # THIS SECTION MUST DIE!
>>>  CP=cp
>>> @@ -498,6 +500,11 @@ AC_SUBST([SNMPLIBS])
>>>  AC_SUBST([SNMP_LCRSO])
>>>  AM_CONDITIONAL(BUILD_SNMP, test "${enable_snmp}" = "1")
>>>  
>>> +if test "x${enable_spinlocks}" = xyes; then
>>> +   AC_CHECK_FUNCS([pthread_spin_lock 
>>> pthread_spin_unlock],,AC_MSG_ERROR(Unable to support spinlocks))
>>> +   PACKAGE_FEATURES="$PACKAGE_FEATURES spinlocks"
>>> +fi
>>> +
>>>  # extra warnings
>>>  EXTRA_WARNINGS=""
>>>  
>>
> 

the patch which was attached to this email is

Reviewed-by: Steven Dake <[email protected]>
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to