File tree Expand file tree Collapse file tree 6 files changed +63
-2
lines changed
mysql-test/suite/sys_vars/t Expand file tree Collapse file tree 6 files changed +63
-2
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,7 @@ INCLUDE(install_macros)
154
154
INCLUDE (systemd )
155
155
INCLUDE (mysql_add_executable )
156
156
INCLUDE (crc32-vpmsum )
157
+ INCLUDE (numa )
157
158
158
159
# Handle options
159
160
OPTION (DISABLE_SHARED
Original file line number Diff line number Diff line change
1
+ MACRO (MYSQL_CHECK_NUMA )
2
+
3
+ CHECK_INCLUDE_FILES (numa.h HAVE_NUMA_H )
4
+ CHECK_INCLUDE_FILES (numaif.h HAVE_NUMAIF_H )
5
+
6
+ IF (HAVE_NUMA_H AND HAVE_NUMAIF_H )
7
+ OPTION (WITH_NUMA "Explicitly set NUMA memory allocation policy" ON )
8
+ ELSE ()
9
+ OPTION (WITH_NUMA "Explicitly set NUMA memory allocation policy" OFF )
10
+ ENDIF ()
11
+
12
+ IF (WITH_NUMA AND HAVE_NUMA_H AND HAVE_NUMAIF_H )
13
+ SET (SAVE_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} )
14
+ SET (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} numa )
15
+ CHECK_C_SOURCE_COMPILES (
16
+ "
17
+ #include <numa.h>
18
+ #include <numaif.h>
19
+ int main()
20
+ {
21
+ struct bitmask *all_nodes= numa_all_nodes_ptr;
22
+ set_mempolicy(MPOL_DEFAULT, 0, 0);
23
+ return all_nodes != NULL;
24
+ }"
25
+ HAVE_LIBNUMA )
26
+ SET (CMAKE_REQUIRED_LIBRARIES ${SAVE_CMAKE_REQUIRED_LIBRARIES} )
27
+ ELSE ()
28
+ SET (HAVE_LIBNUMA 0 )
29
+ ENDIF ()
30
+
31
+ IF (WITH_NUMA AND NOT HAVE_LIBNUMA )
32
+ # Forget it in cache, abort the build.
33
+ UNSET (WITH_NUMA CACHE )
34
+ MESSAGE (FATAL_ERROR "Could not find numa headers/libraries" )
35
+ ENDIF ()
36
+
37
+ ENDMACRO ()
38
+
Original file line number Diff line number Diff line change 106
106
#cmakedefine HAVE_LIBWRAP 1
107
107
#cmakedefine HAVE_SYSTEMD 1
108
108
#cmakedefine HAVE_CRC32_VPMSUM 1
109
+ #cmakedefine HAVE_LIBNUMA 1
109
110
110
111
/* Does "struct timespec" have a "sec" and "nsec" field? */
111
112
#cmakedefine HAVE_TIMESPEC_TS_SEC 1
Original file line number Diff line number Diff line change
1
+ --loose-innodb_numa_interleave=1
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ MYSQL_CHECK_LZO()
29
29
MYSQL_CHECK_LZMA ()
30
30
MYSQL_CHECK_BZIP2 ()
31
31
MYSQL_CHECK_SNAPPY ()
32
+ MYSQL_CHECK_NUMA ()
32
33
33
34
IF (CMAKE_CROSSCOMPILING )
34
35
# Use CHECK_C_SOURCE_COMPILES instead of CHECK_C_SOURCE_RUNS when
@@ -506,8 +507,17 @@ ELSE()
506
507
SET (LINKER_SCRIPT )
507
508
ENDIF ()
508
509
510
+ UNSET (NUMA_LIBRARY )
511
+ IF (HAVE_LIBNUMA )
512
+ SET (NUMA_LIBRARY "numa" )
513
+ ENDIF ()
514
+
509
515
MYSQL_ADD_PLUGIN (innobase ${INNOBASE_SOURCES} STORAGE_ENGINE
510
516
MODULE_ONLY
511
517
MODULE_OUTPUT_NAME ha_innodb
512
- LINK_LIBRARIES ${ZLIB_LIBRARY} ${CRC32_VPMSUM_LIBRARY} ${LINKER_SCRIPT} )
518
+ LINK_LIBRARIES
519
+ ${ZLIB_LIBRARY}
520
+ ${CRC32_VPMSUM_LIBRARY}
521
+ ${NUMA_LIBRARY}
522
+ ${LINKER_SCRIPT} )
513
523
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ MYSQL_CHECK_LZO()
29
29
MYSQL_CHECK_LZMA ()
30
30
MYSQL_CHECK_BZIP2 ()
31
31
MYSQL_CHECK_SNAPPY ()
32
+ MYSQL_CHECK_NUMA ()
32
33
33
34
IF (CMAKE_CROSSCOMPILING )
34
35
# Use CHECK_C_SOURCE_COMPILES instead of CHECK_C_SOURCE_RUNS when
@@ -496,9 +497,18 @@ SET(INNOBASE_SOURCES
496
497
ut/ut0wqueue.cc
497
498
ut/ut0timer.cc )
498
499
500
+ UNSET (NUMA_LIBRARY )
501
+ IF (HAVE_LIBNUMA )
502
+ SET (NUMA_LIBRARY "numa" )
503
+ ENDIF ()
504
+
499
505
MYSQL_ADD_PLUGIN (xtradb ${INNOBASE_SOURCES} STORAGE_ENGINE
500
506
DEFAULT RECOMPILE_FOR_EMBEDDED
501
- LINK_LIBRARIES ${ZLIB_LIBRARY} ${CRC32_VPMSUM_LIBRARY} ${LINKER_SCRIPT} )
507
+ LINK_LIBRARIES
508
+ ${ZLIB_LIBRARY}
509
+ ${CRC32_VPMSUM_LIBRARY}
510
+ ${NUMA_LIBRARY}
511
+ ${LINKER_SCRIPT} )
502
512
503
513
IF (TARGET xtradb AND NOT XTRADB_OK )
504
514
MESSAGE (FATAL_ERROR "Percona XtraDB is not supported on this platform" )
You can’t perform that action at this time.
0 commit comments