From: Date: January 17 2007 9:11pm Subject: bk commit into 5.1 tree (jonas:1.2087) BUG#25686 List-Archive: http://lists.mysql.com/commits/18284 X-Bug: 25686 Message-Id: <20070117201134.A1B5763EFD1@perch.ndb.mysql.com> Below is the list of changes that have just been committed into a local 5.1 repository of jonas. When jonas does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet@stripped, 2007-01-17 21:11:31+01:00, jonas@stripped +6 -0 ndb - bug#25686 Add support for doing mlockall(FUTURE) before malloc instead of mlockall(CURREENT) after malloc (mysql-5.1-wl2325-5.0) storage/ndb/include/portlib/NdbMem.h@stripped, 2007-01-17 21:11:29+01:00, jonas@stripped +1 -1 Add support for doing mlockall(FUTURE) before malloc instead of mlockall(CURREENT) after malloc storage/ndb/src/common/portlib/NdbMem.c@stripped, 2007-01-17 21:11:29+01:00, jonas@stripped +9 -1 Add support for doing mlockall(FUTURE) before malloc instead of mlockall(CURREENT) after malloc storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp@stripped, 2007-01-17 21:11:29+01:00, jonas@stripped +17 -2 Add support for doing mlockall(FUTURE) before malloc instead of mlockall(CURREENT) after malloc storage/ndb/src/kernel/vm/Configuration.cpp@stripped, 2007-01-17 21:11:29+01:00, jonas@stripped +1 -1 Add support for doing mlockall(FUTURE) before malloc instead of mlockall(CURREENT) after malloc storage/ndb/src/kernel/vm/Configuration.hpp@stripped, 2007-01-17 21:11:29+01:00, jonas@stripped +1 -1 Add support for doing mlockall(FUTURE) before malloc instead of mlockall(CURREENT) after malloc storage/ndb/src/mgmsrv/ConfigInfo.cpp@stripped, 2007-01-17 21:11:29+01:00, jonas@stripped +4 -4 Add support for doing mlockall(FUTURE) before malloc instead of mlockall(CURREENT) after malloc # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: jonas # Host: perch.ndb.mysql.com # Root: /home/jonas/src/drop5p17b --- 1.4/storage/ndb/include/portlib/NdbMem.h 2007-01-17 21:11:34 +01:00 +++ 1.5/storage/ndb/include/portlib/NdbMem.h 2007-01-17 21:11:34 +01:00 @@ -66,7 +66,7 @@ * NdbMem_MemLockAll * Locks virtual memory in main memory */ -int NdbMem_MemLockAll(void); +int NdbMem_MemLockAll(int); /** * NdbMem_MemUnlockAll --- 1.76/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2007-01-17 21:11:34 +01:00 +++ 1.77/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2007-01-17 21:11:34 +01:00 @@ -563,10 +563,10 @@ "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, --- 1.13/storage/ndb/src/common/portlib/NdbMem.c 2007-01-17 21:11:34 +01:00 +++ 1.14/storage/ndb/src/common/portlib/NdbMem.c 2007-01-17 21:11:34 +01:00 @@ -57,7 +57,15 @@ } -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 --- 1.29/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp 2007-01-17 21:11:34 +01:00 +++ 1.30/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp 2007-01-17 21:11:34 +01:00 @@ -341,9 +341,9 @@ if (theStartPhase == 1){ jam(); - if(theConfig.lockPagesInMainMemory()) + if(theConfig.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"); @@ -783,6 +783,21 @@ if(globalData.theStartLevel == NodeState::SL_CMVMI){ 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.theRestartFlag = system_started; /** --- 1.46/storage/ndb/src/kernel/vm/Configuration.cpp 2007-01-17 21:11:34 +01:00 +++ 1.47/storage/ndb/src/kernel/vm/Configuration.cpp 2007-01-17 21:11:34 +01:00 @@ -466,7 +466,7 @@ DBUG_VOID_RETURN; } -bool +Uint32 Configuration::lockPagesInMainMemory() const { return _lockPagesInMainMemory; } --- 1.17/storage/ndb/src/kernel/vm/Configuration.hpp 2007-01-17 21:11:34 +01:00 +++ 1.18/storage/ndb/src/kernel/vm/Configuration.hpp 2007-01-17 21:11:34 +01:00 @@ -37,7 +37,7 @@ void setupConfiguration(); void closeConfiguration(); - bool lockPagesInMainMemory() const; + Uint32 lockPagesInMainMemory() const; int timeBetweenWatchDogCheck() const ; void timeBetweenWatchDogCheck(int value);