From: Willy Tarreau Date: Wed, 17 Feb 2021 14:45:01 +0000 (+0100) Subject: Revert "MINOR: threads: change lock_t to an unsigned int" X-Git-Tag: v2.4-dev9~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9ad30a8ad4f247ca03e6532428e77733128c954;p=thirdparty%2Fhaproxy.git Revert "MINOR: threads: change lock_t to an unsigned int" This reverts commit 8f1f177ed0bbdb6c10e61e83994df113452d434f. Repeated tests have shown a small perforamnce degradation of ~1.8% caused by this patch at high request rates on 16 threads. The exact cause is not yet perfectly known but it probably stems in slower accesses for non-64-bit aligned atomic accesses. --- diff --git a/include/haproxy/thread-t.h b/include/haproxy/thread-t.h index bac83aedb0..e827361646 100644 --- a/include/haproxy/thread-t.h +++ b/include/haproxy/thread-t.h @@ -95,8 +95,8 @@ /*** Common parts below ***/ /* storage types used by spinlocks and RW locks */ -#define __HA_SPINLOCK_T unsigned int -#define __HA_RWLOCK_T unsigned int +#define __HA_SPINLOCK_T unsigned long +#define __HA_RWLOCK_T unsigned long /* When thread debugging is enabled, we remap HA_SPINLOCK_T and HA_RWLOCK_T to