Commit d8de8d62 authored by jonas@perch.ndb.mysql.com's avatar jonas@perch.ndb.mysql.com

Merge perch.ndb.mysql.com:/home/jonas/src/50-work

into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.0-ndb
parents 5dac4e99 3af9db79
...@@ -65,7 +65,7 @@ void NdbMem_Free(void* ptr); ...@@ -65,7 +65,7 @@ void NdbMem_Free(void* ptr);
* NdbMem_MemLockAll * NdbMem_MemLockAll
* Locks virtual memory in main memory * Locks virtual memory in main memory
*/ */
int NdbMem_MemLockAll(void); int NdbMem_MemLockAll(int);
/** /**
* NdbMem_MemUnlockAll * NdbMem_MemUnlockAll
......
...@@ -56,7 +56,15 @@ void NdbMem_Free(void* ptr) ...@@ -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) #if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT)
return mlockall(MCL_CURRENT); return mlockall(MCL_CURRENT);
#else #else
......
...@@ -341,9 +341,9 @@ void Cmvmi::execSTTOR(Signal* signal) ...@@ -341,9 +341,9 @@ void Cmvmi::execSTTOR(Signal* signal)
if (theStartPhase == 1){ if (theStartPhase == 1){
jam(); jam();
if(theConfig.lockPagesInMainMemory()) if(theConfig.lockPagesInMainMemory() == 1)
{ {
int res = NdbMem_MemLockAll(); int res = NdbMem_MemLockAll(0);
if(res != 0){ if(res != 0){
g_eventLogger.warning("Failed to memlock pages"); g_eventLogger.warning("Failed to memlock pages");
warningEvent("Failed to memlock pages"); warningEvent("Failed to memlock pages");
...@@ -788,6 +788,21 @@ Cmvmi::execSTART_ORD(Signal* signal) { ...@@ -788,6 +788,21 @@ Cmvmi::execSTART_ORD(Signal* signal) {
if(globalData.theStartLevel == NodeState::SL_CMVMI){ if(globalData.theStartLevel == NodeState::SL_CMVMI){
jam(); jam();
if(theConfig.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.theStartLevel = NodeState::SL_STARTING;
globalData.theRestartFlag = system_started; globalData.theRestartFlag = system_started;
/** /**
......
...@@ -479,7 +479,7 @@ Configuration::setupConfiguration(){ ...@@ -479,7 +479,7 @@ Configuration::setupConfiguration(){
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
bool Uint32
Configuration::lockPagesInMainMemory() const { Configuration::lockPagesInMainMemory() const {
return _lockPagesInMainMemory; return _lockPagesInMainMemory;
} }
......
...@@ -36,7 +36,7 @@ public: ...@@ -36,7 +36,7 @@ public:
void setupConfiguration(); void setupConfiguration();
void closeConfiguration(bool end_session= true); void closeConfiguration(bool end_session= true);
bool lockPagesInMainMemory() const; Uint32 lockPagesInMainMemory() const;
int timeBetweenWatchDogCheck() const ; int timeBetweenWatchDogCheck() const ;
void timeBetweenWatchDogCheck(int value); void timeBetweenWatchDogCheck(int value);
......
...@@ -563,10 +563,10 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -563,10 +563,10 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"If set to yes, then NDB Cluster data will not be swapped out to disk", "If set to yes, then NDB Cluster data will not be swapped out to disk",
ConfigInfo::CI_USED, ConfigInfo::CI_USED,
true, true,
ConfigInfo::CI_BOOL, ConfigInfo::CI_INT,
"false", "0",
"false", "1",
"true" }, "2" },
{ {
CFG_DB_WATCHDOG_INTERVAL, CFG_DB_WATCHDOG_INTERVAL,
......
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