summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/CMakeLists.txt12
-rw-r--r--storage/innobase/buf/buf0buf.cc10
-rw-r--r--storage/xtradb/CMakeLists.txt12
-rw-r--r--storage/xtradb/buf/buf0buf.cc11
4 files changed, 35 insertions, 10 deletions
diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt
index 446e971aacf..d9b50935d27 100644
--- a/storage/innobase/CMakeLists.txt
+++ b/storage/innobase/CMakeLists.txt
@@ -30,6 +30,7 @@ MYSQL_CHECK_LZO()
MYSQL_CHECK_LZMA()
MYSQL_CHECK_BZIP2()
MYSQL_CHECK_SNAPPY()
+MYSQL_CHECK_NUMA()
INCLUDE(innodb.cmake)
@@ -173,11 +174,20 @@ IF(WITH_INNODB)
SET(WITH_INNOBASE_STORAGE_ENGINE TRUE)
ENDIF()
+UNSET(NUMA_LIBRARY)
+IF(HAVE_LIBNUMA)
+ SET(NUMA_LIBRARY "numa")
+ENDIF()
+
MYSQL_ADD_PLUGIN(innobase ${INNOBASE_SOURCES} STORAGE_ENGINE
# MODULE_ONLY
# MODULE_OUTPUT_NAME ha_innodb
DEFAULT RECOMPILE_FOR_EMBEDDED
- LINK_LIBRARIES ${ZLIB_LIBRARY} ${CRC32_VPMSUM_LIBRARY} ${LINKER_SCRIPT})
+ LINK_LIBRARIES
+ ${ZLIB_LIBRARY}
+ ${CRC32_VPMSUM_LIBRARY}
+ ${NUMA_LIBRARY}
+ ${LINKER_SCRIPT})
IF(WITH_INNOBASE_STORAGE_ENGINE)
ADD_DEPENDENCIES(innobase GenError)
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index e187297b231..12d073bf10f 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -96,11 +96,12 @@ struct set_numa_interleave_t
{
if (srv_numa_interleave) {
+ struct bitmask *numa_mems_allowed = numa_get_mems_allowed();
ib::info() << "Setting NUMA memory policy to"
" MPOL_INTERLEAVE";
if (set_mempolicy(MPOL_INTERLEAVE,
- numa_all_nodes_ptr->maskp,
- numa_all_nodes_ptr->size) != 0) {
+ numa_mems_allowed->maskp,
+ numa_mems_allowed->size) != 0) {
ib::warn() << "Failed to set NUMA memory"
" policy to MPOL_INTERLEAVE: "
@@ -1555,10 +1556,11 @@ buf_chunk_init(
#if defined(HAVE_LIBNUMA) && defined(WITH_NUMA)
if (srv_numa_interleave) {
+ struct bitmask *numa_mems_allowed = numa_get_mems_allowed();
int st = mbind(chunk->mem, chunk->mem_size(),
MPOL_INTERLEAVE,
- numa_all_nodes_ptr->maskp,
- numa_all_nodes_ptr->size,
+ numa_mems_allowed->maskp,
+ numa_mems_allowed->size,
MPOL_MF_MOVE);
if (st != 0) {
ib::warn() << "Failed to set NUMA memory policy of"
diff --git a/storage/xtradb/CMakeLists.txt b/storage/xtradb/CMakeLists.txt
index 22897a3b315..7e0bb9103d2 100644
--- a/storage/xtradb/CMakeLists.txt
+++ b/storage/xtradb/CMakeLists.txt
@@ -29,6 +29,7 @@ MYSQL_CHECK_LZO()
MYSQL_CHECK_LZMA()
MYSQL_CHECK_BZIP2()
MYSQL_CHECK_SNAPPY()
+MYSQL_CHECK_NUMA()
IF(CMAKE_CROSSCOMPILING)
# Use CHECK_C_SOURCE_COMPILES instead of CHECK_C_SOURCE_RUNS when
@@ -496,10 +497,19 @@ SET(INNOBASE_SOURCES
ut/ut0wqueue.cc
ut/ut0timer.cc)
+UNSET(NUMA_LIBRARY)
+IF(HAVE_LIBNUMA)
+ SET(NUMA_LIBRARY "numa")
+ENDIF()
+
MYSQL_ADD_PLUGIN(xtradb ${INNOBASE_SOURCES} STORAGE_ENGINE
DISABLED # until upgraded to 5.7, see also mysql-test/include/have_xtradb.combinations
RECOMPILE_FOR_EMBEDDED
- LINK_LIBRARIES ${ZLIB_LIBRARY} ${CRC32_VPMSUM_LIBRARY} ${LINKER_SCRIPT})
+ LINK_LIBRARIES
+ ${ZLIB_LIBRARY}
+ ${CRC32_VPMSUM_LIBRARY}
+ ${NUMA_LIBRARY}
+ ${LINKER_SCRIPT})
IF(TARGET xtradb AND NOT XTRADB_OK)
MESSAGE(FATAL_ERROR "Percona XtraDB is not supported on this platform")
diff --git a/storage/xtradb/buf/buf0buf.cc b/storage/xtradb/buf/buf0buf.cc
index 37b9eaac9c2..6e7f0e44c79 100644
--- a/storage/xtradb/buf/buf0buf.cc
+++ b/storage/xtradb/buf/buf0buf.cc
@@ -1235,10 +1235,11 @@ buf_chunk_init(
#ifdef HAVE_LIBNUMA
if (srv_numa_interleave) {
+ struct bitmask *numa_mems_allowed = numa_get_mems_allowed();
int st = mbind(chunk->mem, chunk->mem_size,
MPOL_INTERLEAVE,
- numa_all_nodes_ptr->maskp,
- numa_all_nodes_ptr->size,
+ numa_mems_allowed->maskp,
+ numa_mems_allowed->size,
MPOL_MF_MOVE);
if (st != 0) {
ib_logf(IB_LOG_LEVEL_WARN,
@@ -1645,11 +1646,13 @@ buf_pool_init(
#ifdef HAVE_LIBNUMA
if (srv_numa_interleave) {
+ struct bitmask *numa_mems_allowed = numa_get_mems_allowed();
+
ib_logf(IB_LOG_LEVEL_INFO,
"Setting NUMA memory policy to MPOL_INTERLEAVE");
if (set_mempolicy(MPOL_INTERLEAVE,
- numa_all_nodes_ptr->maskp,
- numa_all_nodes_ptr->size) != 0) {
+ numa_mems_allowed->maskp,
+ numa_mems_allowed->size) != 0) {
ib_logf(IB_LOG_LEVEL_WARN,
"Failed to set NUMA memory policy to"
" MPOL_INTERLEAVE (error: %s).",