diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-06-27 10:53:18 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-06-27 10:53:18 +0300 |
commit | 042fc2959705eba79b2eae6031d5f9ca5c454c01 (patch) | |
tree | 939ae0ae22856c8b4804f84f2f5438640c8cc35b /config.h.cmake | |
parent | 620f4f8af98666e2efb7e14fb2663ab85b52bc12 (diff) | |
download | mariadb-git-042fc2959705eba79b2eae6031d5f9ca5c454c01.tar.gz |
MDEV-19845: Adaptive spin loops
Starting with the Intel Skylake microarchitecture, the PAUSE
instruction latency is about 140 clock cycles instead of earlier 10.
On AMD processors, the latency could be 10 or 50 clock cycles,
depending on microarchitecture.
Because of this big range of latency, let us scale the loops around
the PAUSE instruction based on timing results at server startup.
my_cpu_relax_multiplier: New variable: How many times to invoke PAUSE
in a loop. Only defined for IA-32 and AMD64.
my_cpu_init(): Determine with RDTSC the time to run 16 PAUSE instructions
in two unrolled loops according, and based on the quicker of the two
runs, initialize my_cpu_relax_multiplier. This form of calibration was
suggested by Mikhail Sinyavin from Intel.
LF_BACKOFF(), ut_delay(): Use my_cpu_relax_multiplier when available.
ut_delay(): Define inline in my_cpu.h.
UT_COMPILER_BARRIER(): Remove. This does not seem to have any effect,
because in our ut_delay() implementation, no computations are being
performed inside the loop. The purpose of UT_COMPILER_BARRIER() was to
prohibit the compiler from reordering computations. It was not
emitting any code.
Diffstat (limited to 'config.h.cmake')
-rw-r--r-- | config.h.cmake | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/config.h.cmake b/config.h.cmake index b8a77899c4d..765d75dfb23 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -187,8 +187,6 @@ #cmakedefine HAVE_LINUX_FALLOC_H 1 #cmakedefine HAVE_FALLOC_PUNCH_HOLE_AND_KEEP_SIZE 1 #cmakedefine HAVE_PREAD 1 -#cmakedefine HAVE_PAUSE_INSTRUCTION 1 -#cmakedefine HAVE_FAKE_PAUSE_INSTRUCTION 1 #cmakedefine HAVE_RDTSCLL 1 #cmakedefine HAVE_READ_REAL_TIME 1 #cmakedefine HAVE_PTHREAD_ATTR_CREATE 1 |