From: Olivier Houchard Date: Fri, 21 Mar 2025 09:56:40 +0000 (+0000) Subject: MEDIUM: mt_list: Reduce the max number of loops with exponential backoff X-Git-Tag: v3.2-dev8~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98967aa09f068f41eddff36fa5b0d4b55ada3acd;p=thirdparty%2Fhaproxy.git MEDIUM: mt_list: Reduce the max number of loops with exponential backoff Reduce the max number of loops in the mt_list code while waiting for a lock to be available with exponential backoff. It's been observed that the current value led to severe performances degradation at least on some hardware, hopefully this value will be acceptable everywhere. --- diff --git a/include/import/mt_list.h b/include/import/mt_list.h index 85863fa34..86d44e517 100644 --- a/include/import/mt_list.h +++ b/include/import/mt_list.h @@ -225,7 +225,7 @@ static inline __attribute__((always_inline)) unsigned long mt_list_cpu_relax(uns /* limit maximum wait time for unlucky threads */ loop = mt_list_wait(loop); - for (loop &= 0x7fffff; loop >= 32; loop--) { + for (loop &= 0xfffff; loop >= 32; loop--) { #if defined(__x86_64__) /* This is a PAUSE instruction on x86_64 */ asm volatile("rep;nop\n");