Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
a1f0a339
Commit
a1f0a339
authored
Oct 24, 2016
by
Jan Lindström
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'grooverdan-10.2-numa' into 10.2
parents
1de147fc
f35f61b5
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
111 additions
and
10 deletions
+111
-10
.travis.yml
.travis.yml
+1
-0
CMakeLists.txt
CMakeLists.txt
+1
-0
cmake/numa.cmake
cmake/numa.cmake
+38
-0
config.h.cmake
config.h.cmake
+1
-0
debian/control
debian/control
+1
-0
mysql-test/include/have_numa.inc
mysql-test/include/have_numa.inc
+9
-0
mysql-test/suite/sys_vars/r/innodb_numa_interleave_basic.result
...test/suite/sys_vars/r/innodb_numa_interleave_basic.result
+10
-0
mysql-test/suite/sys_vars/t/innodb_numa_interleave_basic-master.opt
.../suite/sys_vars/t/innodb_numa_interleave_basic-master.opt
+1
-0
mysql-test/suite/sys_vars/t/innodb_numa_interleave_basic.test
...l-test/suite/sys_vars/t/innodb_numa_interleave_basic.test
+14
-0
storage/innobase/CMakeLists.txt
storage/innobase/CMakeLists.txt
+11
-1
storage/innobase/buf/buf0buf.cc
storage/innobase/buf/buf0buf.cc
+6
-4
storage/xtradb/CMakeLists.txt
storage/xtradb/CMakeLists.txt
+11
-1
storage/xtradb/buf/buf0buf.cc
storage/xtradb/buf/buf0buf.cc
+7
-4
No files found.
.travis.yml
View file @
a1f0a339
...
...
@@ -28,6 +28,7 @@ addons:
-
libpam0g-dev
-
libreadline-gplv2-dev
-
libssl-dev
-
libnuma-dev
-
lsb-release
-
perl
-
po-debconf
...
...
CMakeLists.txt
View file @
a1f0a339
...
...
@@ -162,6 +162,7 @@ INCLUDE(install_macros)
INCLUDE
(
systemd
)
INCLUDE
(
mysql_add_executable
)
INCLUDE
(
crc32-vpmsum
)
INCLUDE
(
numa
)
# Handle options
OPTION
(
DISABLE_SHARED
...
...
cmake/numa.cmake
0 → 100644
View file @
a1f0a339
MACRO
(
MYSQL_CHECK_NUMA
)
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 <numa.h>
#include <numaif.h>
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
}
)
ELSE
()
SET
(
HAVE_LIBNUMA 0
)
ENDIF
()
IF
(
WITH_NUMA AND NOT HAVE_LIBNUMA
)
# Forget it in cache, abort the build.
UNSET
(
WITH_NUMA CACHE
)
MESSAGE
(
FATAL_ERROR
"Could not find numa headers/libraries"
)
ENDIF
()
ENDMACRO
()
config.h.cmake
View file @
a1f0a339
...
...
@@ -106,6 +106,7 @@
#cmakedefine HAVE_LIBWRAP 1
#cmakedefine HAVE_SYSTEMD 1
#cmakedefine HAVE_CRC32_VPMSUM 1
#cmakedefine HAVE_LIBNUMA 1
/* Does
"struct timespec"
have a
"sec"
and
"nsec"
field? */
#cmakedefine HAVE_TIMESPEC_TS_SEC 1
...
...
debian/control
View file @
a1f0a339
...
...
@@ -19,6 +19,7 @@ Build-Depends: bison,
libreadline
-
gplv2
-
dev
,
libssl
-
dev
,
libxml2
-
dev
,
libnuma
-
dev
,
lsb
-
release
,
perl
(>=
5.6.0
),
po
-
debconf
,
...
...
mysql-test/include/have_numa.inc
0 → 100644
View file @
a1f0a339
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
.
}
mysql-test/suite/sys_vars/r/innodb_numa_interleave_basic.result
0 → 100644
View file @
a1f0a339
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
mysql-test/suite/sys_vars/t/innodb_numa_interleave_basic-master.opt
0 → 100644
View file @
a1f0a339
--loose-innodb_numa_interleave=1
mysql-test/suite/sys_vars/t/innodb_numa_interleave_basic.test
0 → 100644
View file @
a1f0a339
--
source
include
/
have_innodb
.
inc
--
source
include
/
have_numa
.
inc
--
source
include
/
have_64bit
.
inc
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
;
storage/innobase/CMakeLists.txt
View file @
a1f0a339
...
...
@@ -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
)
...
...
storage/innobase/buf/buf0buf.cc
View file @
a1f0a339
...
...
@@ -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"
...
...
storage/xtradb/CMakeLists.txt
View file @
a1f0a339
...
...
@@ -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"
)
...
...
storage/xtradb/buf/buf0buf.cc
View file @
a1f0a339
...
...
@@ -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)."
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment