diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2017-11-28 16:34:31 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2018-01-13 13:08:59 +0400 |
commit | 0a63b50c7a2dcab6fe99885cfcbd4a35d322c63a (patch) | |
tree | 21171680f1b855abc7f5d1adfb0b1c50489d5a5c | |
parent | 3dc3ab1a3048484910ca8acccaf76c71b080e533 (diff) | |
download | mariadb-git-0a63b50c7a2dcab6fe99885cfcbd4a35d322c63a.tar.gz |
Cleanup UT_LOW_PRIORITY_CPU/UT_RESUME_PRIORITY_CPU
Server already has HMT_low/HMT_medium.
-rw-r--r-- | config.h.cmake | 1 | ||||
-rw-r--r-- | configure.cmake | 11 | ||||
-rw-r--r-- | include/my_cpu.h | 13 | ||||
-rw-r--r-- | storage/innobase/include/ut0ut.h | 9 | ||||
-rw-r--r-- | storage/innobase/ut/ut0ut.cc | 5 |
5 files changed, 10 insertions, 29 deletions
diff --git a/config.h.cmake b/config.h.cmake index 51abd4b11d5..31a563037a0 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -191,7 +191,6 @@ #cmakedefine HAVE_PREAD 1 #cmakedefine HAVE_PAUSE_INSTRUCTION 1 #cmakedefine HAVE_FAKE_PAUSE_INSTRUCTION 1 -#cmakedefine HAVE_HMT_PRIORITY_INSTRUCTION 1 #cmakedefine HAVE_RDTSCLL 1 #cmakedefine HAVE_READ_REAL_TIME 1 #cmakedefine HAVE_PTHREAD_ATTR_CREATE 1 diff --git a/configure.cmake b/configure.cmake index ffcb9ba83b9..40aca55dc47 100644 --- a/configure.cmake +++ b/configure.cmake @@ -783,17 +783,6 @@ IF(NOT CMAKE_CROSSCOMPILING AND NOT MSVC) } " HAVE_FAKE_PAUSE_INSTRUCTION) ENDIF() - IF (NOT HAVE_PAUSE_INSTRUCTION) - CHECK_C_SOURCE_COMPILES(" - #include <sys/platform/ppc.h> - int main() - { - __ppc_set_ppr_low(); - __ppc_set_ppr_med(); - return 0; - } - " HAVE_HMT_PRIORITY_INSTRUCTION) - ENDIF() ENDIF() CHECK_SYMBOL_EXISTS(tcgetattr "termios.h" HAVE_TCGETATTR 1) diff --git a/include/my_cpu.h b/include/my_cpu.h index 856a8e9b04a..f2e26fca70c 100644 --- a/include/my_cpu.h +++ b/include/my_cpu.h @@ -23,17 +23,18 @@ The defines are the same ones used by the linux kernel */ -#if defined(__powerpc__) +#ifdef _ARCH_PWR8 +#include <sys/platform/ppc.h> /* Very low priority */ -#define HMT_very_low() asm volatile("or 31,31,31") +#define HMT_very_low() __ppc_set_ppr_very_low() /* Low priority */ -#define HMT_low() asm volatile("or 1,1,1") +#define HMT_low() __ppc_set_ppr_low() /* Medium low priority */ -#define HMT_medium_low() asm volatile("or 6,6,6") +#define HMT_medium_low() __ppc_set_ppr_med_low() /* Medium priority */ -#define HMT_medium() asm volatile("or 2,2,2") +#define HMT_medium() __ppc_set_ppr_med() /* Medium high priority */ -#define HMT_medium_high() asm volatile("or 5,5,5") +#define HMT_medium_high() __ppc_set_ppr_med_high() /* High priority */ #define HMT_high() asm volatile("or 3,3,3") #else diff --git a/storage/innobase/include/ut0ut.h b/storage/innobase/include/ut0ut.h index 352f5cce83d..c91e24ad314 100644 --- a/storage/innobase/include/ut0ut.h +++ b/storage/innobase/include/ut0ut.h @@ -60,15 +60,6 @@ typedef time_t ib_time_t; # define UT_COMPILER_BARRIER() #endif -#if defined(HAVE_HMT_PRIORITY_INSTRUCTION) -# include <sys/platform/ppc.h> -# define UT_LOW_PRIORITY_CPU() __ppc_set_ppr_low() -# define UT_RESUME_PRIORITY_CPU() __ppc_set_ppr_med() -#else -# define UT_LOW_PRIORITY_CPU() ((void)0) -# define UT_RESUME_PRIORITY_CPU() ((void)0) -#endif - /*********************************************************************//** Delays execution for at most max_wait_us microseconds or returns earlier if cond becomes true. diff --git a/storage/innobase/ut/ut0ut.cc b/storage/innobase/ut/ut0ut.cc index 88c5c889c8d..25705cb0e2c 100644 --- a/storage/innobase/ut/ut0ut.cc +++ b/storage/innobase/ut/ut0ut.cc @@ -37,6 +37,7 @@ Created 5/11/1994 Heikki Tuuri #include "trx0trx.h" #include <string> #include "log.h" +#include "my_cpu.h" #ifdef _WIN32 /*****************************************************************//** @@ -290,14 +291,14 @@ ut_delay( { ulint i; - UT_LOW_PRIORITY_CPU(); + HMT_low(); for (i = 0; i < delay * 50; i++) { MY_RELAX_CPU(); UT_COMPILER_BARRIER(); } - UT_RESUME_PRIORITY_CPU(); + HMT_medium(); } /*************************************************************//** |