summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorunknown <jonas@perch.ndb.mysql.com>2007-01-17 21:25:56 +0100
committerunknown <jonas@perch.ndb.mysql.com>2007-01-17 21:25:56 +0100
commitaddaf4f765459628d65ba775f500c40c66d01d65 (patch)
treeaf967864cc6a1ff3e0959674b8d25f8bc84c2d90 /storage
parenta7d90c4db6904f3fc44ceb901858ba2f2630fdf3 (diff)
parent7b184fa9dcbd4c34545029f58aee84b576dca08b (diff)
downloadmariadb-git-addaf4f765459628d65ba775f500c40c66d01d65.tar.gz
Merge perch.ndb.mysql.com:/home/jonas/src/51-work
into perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb storage/ndb/include/portlib/NdbMem.h: Auto merged storage/ndb/src/common/portlib/NdbMem.c: Auto merged storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: Auto merged storage/ndb/src/kernel/vm/Configuration.cpp: Auto merged storage/ndb/src/kernel/vm/Configuration.hpp: Auto merged storage/ndb/src/mgmsrv/ConfigInfo.cpp: Auto merged
Diffstat (limited to 'storage')
-rw-r--r--storage/ndb/include/portlib/NdbMem.h2
-rw-r--r--storage/ndb/src/common/portlib/NdbMem.c10
-rw-r--r--storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp19
-rw-r--r--storage/ndb/src/kernel/vm/Configuration.cpp2
-rw-r--r--storage/ndb/src/kernel/vm/Configuration.hpp2
-rw-r--r--storage/ndb/src/mgmsrv/ConfigInfo.cpp8
6 files changed, 33 insertions, 10 deletions
diff --git a/storage/ndb/include/portlib/NdbMem.h b/storage/ndb/include/portlib/NdbMem.h
index 90130293c4d..d271c976862 100644
--- a/storage/ndb/include/portlib/NdbMem.h
+++ b/storage/ndb/include/portlib/NdbMem.h
@@ -65,7 +65,7 @@ void NdbMem_Free(void* ptr);
* NdbMem_MemLockAll
* Locks virtual memory in main memory
*/
-int NdbMem_MemLockAll(void);
+int NdbMem_MemLockAll(int);
/**
* NdbMem_MemUnlockAll
diff --git a/storage/ndb/src/common/portlib/NdbMem.c b/storage/ndb/src/common/portlib/NdbMem.c
index c8e89f5f278..7c95e02cd0c 100644
--- a/storage/ndb/src/common/portlib/NdbMem.c
+++ b/storage/ndb/src/common/portlib/NdbMem.c
@@ -56,7 +56,15 @@ void NdbMem_Free(void* ptr)
}
-int NdbMem_MemLockAll(){
+int NdbMem_MemLockAll(int i){
+ if (i == 1)
+ {
+#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT) && defined (MCL_FUTURE)
+ return mlockall(MCL_CURRENT | MCL_FUTURE);
+#else
+ return -1;
+#endif
+ }
#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT)
return mlockall(MCL_CURRENT);
#else
diff --git a/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
index c1270103ad4..57828fa928f 100644
--- a/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
+++ b/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
@@ -368,9 +368,9 @@ void Cmvmi::execSTTOR(Signal* signal)
if (theStartPhase == 1){
jam();
- if(m_ctx.m_config.lockPagesInMainMemory())
+ if(m_ctx.m_config.lockPagesInMainMemory() == 1)
{
- int res = NdbMem_MemLockAll();
+ int res = NdbMem_MemLockAll(0);
if(res != 0){
g_eventLogger.warning("Failed to memlock pages");
warningEvent("Failed to memlock pages");
@@ -812,6 +812,21 @@ Cmvmi::execSTART_ORD(Signal* signal) {
if(globalData.theStartLevel == NodeState::SL_CMVMI){
jam();
+
+ if(m_ctx.m_config.lockPagesInMainMemory() == 2)
+ {
+ int res = NdbMem_MemLockAll(1);
+ if(res != 0)
+ {
+ g_eventLogger.warning("Failed to memlock pages");
+ warningEvent("Failed to memlock pages");
+ }
+ else
+ {
+ g_eventLogger.info("Locked future allocations");
+ }
+ }
+
globalData.theStartLevel = NodeState::SL_STARTING;
globalData.theRestartFlag = system_started;
/**
diff --git a/storage/ndb/src/kernel/vm/Configuration.cpp b/storage/ndb/src/kernel/vm/Configuration.cpp
index d0a3b3c78a8..e0b485eda59 100644
--- a/storage/ndb/src/kernel/vm/Configuration.cpp
+++ b/storage/ndb/src/kernel/vm/Configuration.cpp
@@ -479,7 +479,7 @@ Configuration::setupConfiguration(){
DBUG_VOID_RETURN;
}
-bool
+Uint32
Configuration::lockPagesInMainMemory() const {
return _lockPagesInMainMemory;
}
diff --git a/storage/ndb/src/kernel/vm/Configuration.hpp b/storage/ndb/src/kernel/vm/Configuration.hpp
index 563e031a684..934261e40af 100644
--- a/storage/ndb/src/kernel/vm/Configuration.hpp
+++ b/storage/ndb/src/kernel/vm/Configuration.hpp
@@ -36,7 +36,7 @@ public:
void setupConfiguration();
void closeConfiguration(bool end_session= true);
- bool lockPagesInMainMemory() const;
+ Uint32 lockPagesInMainMemory() const;
int timeBetweenWatchDogCheck() const ;
void timeBetweenWatchDogCheck(int value);
diff --git a/storage/ndb/src/mgmsrv/ConfigInfo.cpp b/storage/ndb/src/mgmsrv/ConfigInfo.cpp
index c61288e5b7c..fe0e7c9f429 100644
--- a/storage/ndb/src/mgmsrv/ConfigInfo.cpp
+++ b/storage/ndb/src/mgmsrv/ConfigInfo.cpp
@@ -554,10 +554,10 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"If set to yes, then NDB Cluster data will not be swapped out to disk",
ConfigInfo::CI_USED,
true,
- ConfigInfo::CI_BOOL,
- "false",
- "false",
- "true" },
+ ConfigInfo::CI_INT,
+ "0",
+ "1",
+ "2" },
{
CFG_DB_WATCHDOG_INTERVAL,