MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:jonas Date:January 17 2007 8:15pm
Subject:bk commit into 5.0 tree (jonas:1.2283) BUG#25686
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 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:15:13+01:00, jonas@stripped +6 -0
  ndb - bug#25686
    add support for doing mlockall before mallc instead of after
    (recommit in 5.0)

  ndb/include/portlib/NdbMem.h@stripped, 2007-01-17 21:15:11+01:00, jonas@stripped +1 -1
    add support for doing mlockall before mallc instead of after

  ndb/src/common/portlib/NdbMem.c@stripped, 2007-01-17 21:15:11+01:00, jonas@stripped +9 -1
    add support for doing mlockall before mallc instead of after

  ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp@stripped, 2007-01-17 21:15:11+01:00, jonas@stripped +17 -2
    add support for doing mlockall before mallc instead of after

  ndb/src/kernel/vm/Configuration.cpp@stripped, 2007-01-17 21:15:11+01:00, jonas@stripped +1 -1
    add support for doing mlockall before mallc instead of after

  ndb/src/kernel/vm/Configuration.hpp@stripped, 2007-01-17 21:15:11+01:00, jonas@stripped +1 -1
    add support for doing mlockall before mallc instead of after

  ndb/src/mgmsrv/ConfigInfo.cpp@stripped, 2007-01-17 21:15:12+01:00, jonas@stripped +4 -4
    add support for doing mlockall before mallc instead of after

# 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/50-work

--- 1.3/ndb/include/portlib/NdbMem.h	2007-01-17 21:15:17 +01:00
+++ 1.4/ndb/include/portlib/NdbMem.h	2007-01-17 21:15:17 +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.78/ndb/src/mgmsrv/ConfigInfo.cpp	2007-01-17 21:15:17 +01:00
+++ 1.79/ndb/src/mgmsrv/ConfigInfo.cpp	2007-01-17 21:15:17 +01:00
@@ -564,10 +564,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.12/ndb/src/common/portlib/NdbMem.c	2007-01-17 21:15:17 +01:00
+++ 1.13/ndb/src/common/portlib/NdbMem.c	2007-01-17 21:15:17 +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.28/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp	2007-01-17 21:15:17 +01:00
+++ 1.29/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp	2007-01-17 21:15:17 +01:00
@@ -342,9 +342,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");
@@ -788,6 +788,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.48/ndb/src/kernel/vm/Configuration.cpp	2007-01-17 21:15:17 +01:00
+++ 1.49/ndb/src/kernel/vm/Configuration.cpp	2007-01-17 21:15:17 +01:00
@@ -477,7 +477,7 @@
   DBUG_VOID_RETURN;
 }
 
-bool 
+Uint32
 Configuration::lockPagesInMainMemory() const {
   return _lockPagesInMainMemory;
 }

--- 1.18/ndb/src/kernel/vm/Configuration.hpp	2007-01-17 21:15:17 +01:00
+++ 1.19/ndb/src/kernel/vm/Configuration.hpp	2007-01-17 21:15:17 +01:00
@@ -37,7 +37,7 @@
   void setupConfiguration();
   void closeConfiguration(bool end_session= true);
   
-  bool lockPagesInMainMemory() const;
+  Uint32 lockPagesInMainMemory() const;
   
   int timeBetweenWatchDogCheck() const ;
   void timeBetweenWatchDogCheck(int value);
Thread
bk commit into 5.0 tree (jonas:1.2283) BUG#25686jonas17 Jan