From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 21AB6138334 for ; Sun, 4 Nov 2018 22:52:23 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E4CC8E09E4; Sun, 4 Nov 2018 22:52:21 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A7634E09E4 for ; Sun, 4 Nov 2018 22:52:21 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B7F95335C58 for ; Sun, 4 Nov 2018 22:52:19 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 668B943E for ; Sun, 4 Nov 2018 22:52:18 +0000 (UTC) From: "Brian Evans" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Evans" Message-ID: <1541371895.239f0e8dd9c003252a3c627d86c06744918bd965.grknight@gentoo> Subject: [gentoo-commits] proj/mysql-extras:master commit in: / X-VCS-Repository: proj/mysql-extras X-VCS-Files: 20029_all_mariadb-10.1.37-enable-numa.patch X-VCS-Directories: / X-VCS-Committer: grknight X-VCS-Committer-Name: Brian Evans X-VCS-Revision: 239f0e8dd9c003252a3c627d86c06744918bd965 X-VCS-Branch: master Date: Sun, 4 Nov 2018 22:52:18 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 537a53c4-b29c-4c31-9d3a-e5cc6ec15be1 X-Archives-Hash: 652f316324631e0ca2fea40b50ab5532 commit: 239f0e8dd9c003252a3c627d86c06744918bd965 Author: Brian Evans gentoo org> AuthorDate: Sun Nov 4 22:51:35 2018 +0000 Commit: Brian Evans gentoo org> CommitDate: Sun Nov 4 22:51:35 2018 +0000 URL: https://gitweb.gentoo.org/proj/mysql-extras.git/commit/?id=239f0e8d Respin numa patch for mariadb 10.1.37 Signed-off-by: Brian Evans gentoo.org> 20029_all_mariadb-10.1.37-enable-numa.patch | 204 ++++++++++++++++++++++++++++ 1 file changed, 204 insertions(+) diff --git a/20029_all_mariadb-10.1.37-enable-numa.patch b/20029_all_mariadb-10.1.37-enable-numa.patch new file mode 100644 index 0000000..a924534 --- /dev/null +++ b/20029_all_mariadb-10.1.37-enable-numa.patch @@ -0,0 +1,204 @@ +Backport MariaDB 10.2 support into 10.1 + +diff --git a/cmake/numa.cmake b/cmake/numa.cmake +new file mode 100644 +index 000000000000..d5234a5ef4f6 +--- /dev/null ++++ b/cmake/numa.cmake +@@ -0,0 +1,43 @@ ++MACRO (MYSQL_CHECK_NUMA) ++ ++ IF(CMAKE_SYSTEM_NAME MATCHES "Linux") ++ CHECK_INCLUDE_FILES(numa.h HAVE_NUMA_H) ++ CHECK_INCLUDE_FILES(numaif.h HAVE_NUMAIF_H) ++ ++ IF(HAVE_NUMA_H AND HAVE_NUMAIF_H) ++ OPTION(WITH_NUMA "Explicitly set NUMA memory allocation policy" ON) ++ ELSE() ++ OPTION(WITH_NUMA "Explicitly set NUMA memory allocation policy" OFF) ++ ENDIF() ++ ++ IF(WITH_NUMA AND HAVE_NUMA_H AND HAVE_NUMAIF_H) ++ SET(SAVE_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) ++ SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} numa) ++ CHECK_C_SOURCE_COMPILES( ++ " ++ #include ++ #include ++ int main() ++ { ++ struct bitmask *all_nodes= numa_all_nodes_ptr; ++ set_mempolicy(MPOL_DEFAULT, 0, 0); ++ return all_nodes != NULL; ++ }" ++ HAVE_LIBNUMA) ++ SET(CMAKE_REQUIRED_LIBRARIES ${SAVE_CMAKE_REQUIRED_LIBRARIES}) ++ IF(HAVE_LIBNUMA) ++ ADD_DEFINITIONS(-DHAVE_LIBNUMA=1) ++ SET(NUMA_LIBRARY "numa") ++ ENDIF() ++ ENDIF() ++ ++ IF(WITH_NUMA AND NOT HAVE_LIBNUMA) ++ # Forget it in cache, abort the build. ++ UNSET(WITH_NUMA CACHE) ++ UNSET(NUMA_LIBRARY CACHE) ++ MESSAGE(FATAL_ERROR "Could not find numa headers/libraries") ++ ENDIF() ++ ENDIF() ++ ++ENDMACRO() ++ +diff --git a/mysql-test/suite/sys_vars/t/innodb_numa_interleave_basic-master.opt b/mysql-test/suite/sys_vars/t/innodb_numa_interleave_basic-master.opt +new file mode 100644 +index 000000000000..c1c2bb26b8ac +--- /dev/null ++++ b/mysql-test/suite/sys_vars/t/innodb_numa_interleave_basic-master.opt +@@ -0,0 +1,1 @@ ++--loose-innodb_numa_interleave=1 +diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt +index 7e667d5ebb29..c80ef6f09937 100644 +--- a/storage/innobase/CMakeLists.txt ++++ b/storage/innobase/CMakeLists.txt +@@ -23,12 +23,14 @@ INCLUDE(lzo) + INCLUDE(lzma) + INCLUDE(bzip2) + INCLUDE(snappy) ++INCLUDE(numa) + + MYSQL_CHECK_LZ4() + 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 +@@ -63,5 +63,2 @@ + ENDIF() + ADD_DEFINITIONS("-DUNIV_LINUX -D_GNU_SOURCE=1") +- IF(HAVE_LIBNUMA) +- LINK_LIBRARIES(numa) +- ENDIF() +@@ -517,6 +517,10 @@ + MYSQL_ADD_PLUGIN(innobase ${INNOBASE_SOURCES} STORAGE_ENGINE + MODULE_ONLY + MODULE_OUTPUT_NAME ha_innodb +- LINK_LIBRARIES ${ZLIB_LIBRARY} ${LIBSYSTEMD} ${LINKER_SCRIPT}) ++ LINK_LIBRARIES ++ ${ZLIB_LIBRARY} ++ ${NUMA_LIBRARY} ++ ${LIBSYSTEMD} ++ ${LINKER_SCRIPT}) + + ADD_DEPENDENCIES(innobase GenError) +diff --git a/storage/xtradb/CMakeLists.txt b/storage/xtradb/CMakeLists.txt +index 7d2a3fad56dc..51e24b3cd8a2 100644 +--- a/storage/xtradb/CMakeLists.txt ++++ b/storage/xtradb/CMakeLists.txt +@@ -23,12 +23,14 @@ INCLUDE(lzo) + INCLUDE(lzma) + INCLUDE(bzip2) + INCLUDE(snappy) ++INCLUDE(numa) + + MYSQL_CHECK_LZ4() + 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 +@@ -504,11 +504,6 @@ + ) + ENDIF() + +-UNSET(NUMA_LIBRARY) +-IF(HAVE_LIBNUMA) +- SET(NUMA_LIBRARY "numa") +-ENDIF() +- + MYSQL_ADD_PLUGIN(xtradb ${INNOBASE_SOURCES} STORAGE_ENGINE + DEFAULT + RECOMPILE_FOR_EMBEDDED +diff --git a/mysql-test/include/have_numa.inc b/mysql-test/include/have_numa.inc +new file mode 100644 +index 000000000000..18bca99e04d7 +--- /dev/null ++++ b/mysql-test/include/have_numa.inc +@@ -0,0 +1,9 @@ ++let $numa_support = `SELECT COUNT(VARIABLE_VALUE) = 1 FROM ++ INFORMATION_SCHEMA.GLOBAL_VARIABLES ++ WHERE VARIABLE_NAME='innodb_numa_interleave'`; ++ ++if ( $numa_support == 0 ) ++{ ++ --skip Test requires: Binary must be built with NUMA support. ++} ++ +diff --git a/mysql-test/suite/sys_vars/r/innodb_numa_interleave_basic.result b/mysql-test/suite/sys_vars/r/innodb_numa_interleave_basic.result +new file mode 100644 +index 000000000000..21ed16c1dab8 +--- /dev/null ++++ b/mysql-test/suite/sys_vars/r/innodb_numa_interleave_basic.result +@@ -0,0 +1,11 @@ ++call mtr.add_suppression("InnoDB: Failed to set NUMA memory policy"); ++SELECT @@GLOBAL.innodb_numa_interleave; ++@@GLOBAL.innodb_numa_interleave ++1 ++SET @@GLOBAL.innodb_numa_interleave=off; ++ERROR HY000: Variable 'innodb_numa_interleave' is a read only variable ++SELECT @@GLOBAL.innodb_numa_interleave; ++@@GLOBAL.innodb_numa_interleave ++1 ++SELECT @@SESSION.innodb_numa_interleave; ++ERROR HY000: Variable 'innodb_numa_interleave' is a GLOBAL variable +diff --git a/mysql-test/suite/sys_vars/t/innodb_numa_interleave_basic.test b/mysql-test/suite/sys_vars/t/innodb_numa_interleave_basic.test +new file mode 100644 +index 000000000000..518b5ebba177 +--- /dev/null ++++ b/mysql-test/suite/sys_vars/t/innodb_numa_interleave_basic.test +@@ -0,0 +1,15 @@ ++--source include/have_innodb.inc ++--source include/have_numa.inc ++ ++call mtr.add_suppression("InnoDB: Failed to set NUMA memory policy"); ++ ++SELECT @@GLOBAL.innodb_numa_interleave; ++ ++--error ER_INCORRECT_GLOBAL_LOCAL_VAR ++SET @@GLOBAL.innodb_numa_interleave=off; ++ ++SELECT @@GLOBAL.innodb_numa_interleave; ++ ++--error ER_INCORRECT_GLOBAL_LOCAL_VAR ++SELECT @@SESSION.innodb_numa_interleave; ++ +diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result +index 87e000faf025..ad6dcc1bb643 100644 +--- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result ++++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result +@@ -2,6 +2,7 @@ select * from information_schema.system_variables + where variable_name like 'innodb%' and + variable_name not in ( + 'innodb_disallow_writes', # only available WITH_WSREP ++'innodb_numa_interleave', # only available WITH_NUMA + 'innodb_sched_priority_cleaner', # linux only + 'innodb_use_native_aio') # default value depends on OS + order by variable_name; +diff --git a/mysql-test/suite/sys_vars/t/sysvars_innodb.test b/mysql-test/suite/sys_vars/t/sysvars_innodb.test +index bd8442b6a443..38f248cb6113 100644 +--- a/mysql-test/suite/sys_vars/t/sysvars_innodb.test ++++ b/mysql-test/suite/sys_vars/t/sysvars_innodb.test +@@ -9,6 +9,7 @@ select * from information_schema.system_variables + where variable_name like 'innodb%' and + variable_name not in ( + 'innodb_disallow_writes', # only available WITH_WSREP ++ 'innodb_numa_interleave', # only available WITH_NUMA + 'innodb_sched_priority_cleaner', # linux only + 'innodb_use_native_aio') # default value depends on OS + order by variable_name; +