Commit ab0e5031 authored by Daniel Black's avatar Daniel Black

MDEV-11195: Correct enablement of NUMA in innodb/xtradb

No -DHAVE_LIBNUMA=1 was passed to the source compile (and the
global include/my_config.h wasn't used).

This also is Linux only so corrected the cmake macro.

Fixed indenting in cmake macro.

Removed NUMA defination from include/my_config.h as its only
in the storage engine.

Thanks Elena Stepanova and Vladislav Vaintroub for the detailed
list of bugs/questions.
Signed-off-by: default avatarDaniel Black <daniel.black@au.ibm.com>
parent 71e11bce
...@@ -162,7 +162,6 @@ INCLUDE(install_macros) ...@@ -162,7 +162,6 @@ INCLUDE(install_macros)
INCLUDE(systemd) INCLUDE(systemd)
INCLUDE(mysql_add_executable) INCLUDE(mysql_add_executable)
INCLUDE(crc32-vpmsum) INCLUDE(crc32-vpmsum)
INCLUDE(numa)
# Handle options # Handle options
OPTION(DISABLE_SHARED OPTION(DISABLE_SHARED
......
MACRO (MYSQL_CHECK_NUMA) MACRO (MYSQL_CHECK_NUMA)
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
CHECK_INCLUDE_FILES(numa.h HAVE_NUMA_H) CHECK_INCLUDE_FILES(numa.h HAVE_NUMA_H)
CHECK_INCLUDE_FILES(numaif.h HAVE_NUMAIF_H) CHECK_INCLUDE_FILES(numaif.h HAVE_NUMAIF_H)
...@@ -10,22 +11,25 @@ MACRO (MYSQL_CHECK_NUMA) ...@@ -10,22 +11,25 @@ MACRO (MYSQL_CHECK_NUMA)
ENDIF() ENDIF()
IF(WITH_NUMA AND HAVE_NUMA_H AND HAVE_NUMAIF_H) IF(WITH_NUMA AND HAVE_NUMA_H AND HAVE_NUMAIF_H)
SET(SAVE_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) SET(SAVE_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} numa) SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} numa)
CHECK_C_SOURCE_COMPILES( CHECK_C_SOURCE_COMPILES(
" "
#include <numa.h> #include <numa.h>
#include <numaif.h> #include <numaif.h>
int main() int main()
{ {
struct bitmask *all_nodes= numa_all_nodes_ptr; struct bitmask *all_nodes= numa_all_nodes_ptr;
set_mempolicy(MPOL_DEFAULT, 0, 0); set_mempolicy(MPOL_DEFAULT, 0, 0);
return all_nodes != NULL; return all_nodes != NULL;
}" }"
HAVE_LIBNUMA) HAVE_LIBNUMA)
SET(CMAKE_REQUIRED_LIBRARIES ${SAVE_CMAKE_REQUIRED_LIBRARIES}) SET(CMAKE_REQUIRED_LIBRARIES ${SAVE_CMAKE_REQUIRED_LIBRARIES})
IF(HAVE_LIBNUMA)
ADD_DEFINITIONS(-DHAVE_LIBNUMA=1)
ENDIF()
ELSE() ELSE()
SET(HAVE_LIBNUMA 0) SET(HAVE_LIBNUMA 0)
ENDIF() ENDIF()
IF(WITH_NUMA AND NOT HAVE_LIBNUMA) IF(WITH_NUMA AND NOT HAVE_LIBNUMA)
...@@ -33,6 +37,9 @@ MACRO (MYSQL_CHECK_NUMA) ...@@ -33,6 +37,9 @@ MACRO (MYSQL_CHECK_NUMA)
UNSET(WITH_NUMA CACHE) UNSET(WITH_NUMA CACHE)
MESSAGE(FATAL_ERROR "Could not find numa headers/libraries") MESSAGE(FATAL_ERROR "Could not find numa headers/libraries")
ENDIF() ENDIF()
ELSE()
SET(HAVE_LIBNUMA 0)
ENDIF()
ENDMACRO() ENDMACRO()
...@@ -106,7 +106,6 @@ ...@@ -106,7 +106,6 @@
#cmakedefine HAVE_LIBWRAP 1 #cmakedefine HAVE_LIBWRAP 1
#cmakedefine HAVE_SYSTEMD 1 #cmakedefine HAVE_SYSTEMD 1
#cmakedefine HAVE_CRC32_VPMSUM 1 #cmakedefine HAVE_CRC32_VPMSUM 1
#cmakedefine HAVE_LIBNUMA 1
/* Does "struct timespec" have a "sec" and "nsec" field? */ /* Does "struct timespec" have a "sec" and "nsec" field? */
#cmakedefine HAVE_TIMESPEC_TS_SEC 1 #cmakedefine HAVE_TIMESPEC_TS_SEC 1
......
...@@ -24,6 +24,7 @@ INCLUDE(lzo) ...@@ -24,6 +24,7 @@ INCLUDE(lzo)
INCLUDE(lzma) INCLUDE(lzma)
INCLUDE(bzip2) INCLUDE(bzip2)
INCLUDE(snappy) INCLUDE(snappy)
INCLUDE(numa)
MYSQL_CHECK_LZ4() MYSQL_CHECK_LZ4()
MYSQL_CHECK_LZO() MYSQL_CHECK_LZO()
......
...@@ -23,6 +23,7 @@ INCLUDE(lzo) ...@@ -23,6 +23,7 @@ INCLUDE(lzo)
INCLUDE(lzma) INCLUDE(lzma)
INCLUDE(bzip2) INCLUDE(bzip2)
INCLUDE(snappy) INCLUDE(snappy)
INCLUDE(numa)
MYSQL_CHECK_LZ4() MYSQL_CHECK_LZ4()
MYSQL_CHECK_LZO() MYSQL_CHECK_LZO()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment