summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrunal Bauskar <mysqlonarm@gmail.com>2021-03-30 15:57:14 +0800
committerMarko Mäkelä <marko.makela@mariadb.com>2021-03-30 13:26:19 +0300
commit76d2846a71a155ee2861fd52e6635e35490a9dd1 (patch)
tree691647e5683fb4465665bd4426c1b86b9056043c
parent8c2e3259c13d1d0a494fb3f9c1e5fb780a193ab1 (diff)
downloadmariadb-git-76d2846a71a155ee2861fd52e6635e35490a9dd1.tar.gz
MDEV-24630: MY_RELAX_CPU assembly instruction upgrade/research for
            memory barrier on ARM As suggested in the said JIRA ticket based on the contribution done by the community (in an attempt to optimize the spin-loop) the said approach was evaluated against MariaDB Server 10.5 and found to help improve throughput in the range of 2-5%. Note: 10.6 timing graph and model are different as home-brew mutexes are replaced with pthread mutexes. Said patch has mixed impact on 10.6 so not recommended for 10.6.
-rw-r--r--include/my_cpu.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/my_cpu.h b/include/my_cpu.h
index e536ff285f9..b42d62e7e82 100644
--- a/include/my_cpu.h
+++ b/include/my_cpu.h
@@ -84,7 +84,7 @@ static inline void MY_RELAX_CPU(void)
__ppc_get_timebase();
#elif defined __GNUC__ && (defined __arm__ || defined __aarch64__)
/* Mainly, prevent the compiler from optimizing away delay loops */
- __asm__ __volatile__ ("":::"memory");
+ __asm__ __volatile__ ("isb":::"memory");
#else
int32 var, oldval = 0;
my_atomic_cas32_strong_explicit(&var, &oldval, 1, MY_MEMORY_ORDER_RELAXED,