Commit 4c610d10 authored by Marko Mäkelä's avatar Marko Mäkelä

Post-fix for MDEV-11195 NUMA does not get enabled even when checks are passed

The C preprocessor symbol WITH_NUMA is never defined. Instead, the symbol
HAVE_LIBNUMA is used for checking if the feature is to be used.

If cmake -DWITH_NUMA=OFF is specified, HAVE_LIBNUMA will not be defined
at compilation time even if the library is available.

If cmake -DWITH_NUMA=ON is specified but the library is not available
at configuration time, the compilation will be aborted.
parent efcd0935
......@@ -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;
......
--source include/have_innodb.inc
--source include/have_numa.inc
--source include/have_64bit.inc
SELECT @@GLOBAL.innodb_numa_interleave;
......
......@@ -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;
......@@ -2,7 +2,7 @@
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Copyright (c) 2013, 2016, MariaDB Corporation. All Rights Reserved.
Copyright (c) 2013, 2017, MariaDB Corporation. All Rights Reserved.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
......@@ -85,7 +85,7 @@ Created 11/5/1995 Heikki Tuuri
#include "lzo/lzo1x.h"
#endif
#if defined(HAVE_LIBNUMA) && defined(WITH_NUMA)
#ifdef HAVE_LIBNUMA
#include <numa.h>
#include <numaif.h>
struct set_numa_interleave_t
......@@ -126,7 +126,7 @@ struct set_numa_interleave_t
#define NUMA_MEMPOLICY_INTERLEAVE_IN_SCOPE set_numa_interleave_t scoped_numa
#else
#define NUMA_MEMPOLICY_INTERLEAVE_IN_SCOPE
#endif /* HAVE_LIBNUMA && WITH_NUMA */
#endif /* HAVE_LIBNUMA */
/* Enable this for checksum error messages. */
//#ifdef UNIV_DEBUG
......@@ -1608,7 +1608,7 @@ buf_chunk_init(
return(NULL);
}
#if defined(HAVE_LIBNUMA) && defined(WITH_NUMA)
#ifdef HAVE_LIBNUMA
if (srv_numa_interleave) {
struct bitmask *numa_mems_allowed = numa_get_mems_allowed();
int st = mbind(chunk->mem, chunk->mem_size(),
......@@ -1622,7 +1622,7 @@ buf_chunk_init(
" (error: " << strerror(errno) << ").";
}
}
#endif /* HAVE_LIBNUMA && WITH_NUMA */
#endif /* HAVE_LIBNUMA */
/* Allocate the block descriptors from
......
......@@ -4,7 +4,7 @@ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
Copyright (c) 2012, Facebook Inc.
Copyright (c) 2013, 2016, MariaDB Corporation.
Copyright (c) 2013, 2017, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
......@@ -22724,12 +22724,12 @@ static MYSQL_SYSVAR_BOOL(use_native_aio, srv_use_native_aio,
"Use native AIO if supported on this platform.",
NULL, NULL, TRUE);
#if defined(HAVE_LIBNUMA) && defined(WITH_NUMA)
#ifdef HAVE_LIBNUMA
static MYSQL_SYSVAR_BOOL(numa_interleave, srv_numa_interleave,
PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
"Use NUMA interleave memory policy to allocate InnoDB buffer pool.",
NULL, NULL, FALSE);
#endif /* HAVE_LIBNUMA && WITH_NUMA */
#endif /* HAVE_LIBNUMA */
static MYSQL_SYSVAR_BOOL(api_enable_binlog, ib_binlog_enabled,
PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
......@@ -23276,9 +23276,9 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(autoinc_lock_mode),
MYSQL_SYSVAR(version),
MYSQL_SYSVAR(use_native_aio),
#if defined(HAVE_LIBNUMA) && defined(WITH_NUMA)
#ifdef HAVE_LIBNUMA
MYSQL_SYSVAR(numa_interleave),
#endif /* HAVE_LIBNUMA && WITH_NUMA */
#endif /* HAVE_LIBNUMA */
MYSQL_SYSVAR(change_buffering),
MYSQL_SYSVAR(change_buffer_max_size),
#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
......
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