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

into  perch.ndb.mysql.com:/home/jonas/src/51-work


storage/ndb/include/portlib/NdbMem.h:
  Auto merged
storage/ndb/src/common/portlib/NdbMem.c:
  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
storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp:
  merge
This commit is contained in:
unknown 2007-01-17 21:23:59 +01:00
commit 7b184fa9dc
6 changed files with 33 additions and 10 deletions

View file

@ -66,7 +66,7 @@ void NdbMem_Free(void* ptr);
* NdbMem_MemLockAll
* Locks virtual memory in main memory
*/
int NdbMem_MemLockAll(void);
int NdbMem_MemLockAll(int);
/**
* NdbMem_MemUnlockAll

View file

@ -57,7 +57,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

View file

@ -369,9 +369,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");
@ -813,6 +813,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;
/**

View file

@ -480,7 +480,7 @@ Configuration::setupConfiguration(){
DBUG_VOID_RETURN;
}
bool
Uint32
Configuration::lockPagesInMainMemory() const {
return _lockPagesInMainMemory;
}

View file

@ -37,7 +37,7 @@ public:
void setupConfiguration();
void closeConfiguration(bool end_session= true);
bool lockPagesInMainMemory() const;
Uint32 lockPagesInMainMemory() const;
int timeBetweenWatchDogCheck() const ;
void timeBetweenWatchDogCheck(int value);

View file

@ -555,10 +555,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,