From 98967aa09f068f41eddff36fa5b0d4b55ada3acd Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Fri, 21 Mar 2025 09:56:40 +0000 Subject: [PATCH] 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. --- include/import/mt_list.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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");