List:Commits« Previous MessageNext Message »
From:jonas Date:June 12 2007 7:19am
Subject:bk commit into 5.1 tree (jonas:1.2529)
View as plain text  
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-06-12 09:19:39+02:00, jonas@stripped +2 -0
  Merge perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
  into  perch.ndb.mysql.com:/home/jonas/src/51-telco
  MERGE: 1.2506.1.27

  storage/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp@stripped, 2007-06-12 09:19:16+02:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.14.1.3

  storage/ndb/src/kernel/blocks/dbtup/DbtupPagMan.cpp@stripped, 2007-06-12 09:19:32+02:00, jonas@stripped +0 -43
    MERGE: 1.10.1.2

# 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/51-telco/RESYNC

--- 1.18/storage/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp	2007-06-12 09:19:44 +02:00
+++ 1.19/storage/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp	2007-06-12 09:19:44 +02:00
@@ -74,6 +74,10 @@
   sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 6, JBB);
 }
 
+#ifdef VM_TRACE
+extern Uint32 fc_left, fc_right, fc_remove;
+#endif
+
 void
 Dbtup::execDUMP_STATE_ORD(Signal* signal)
 {
@@ -155,12 +159,20 @@
     return;
   }//if
 #endif
-#if defined VM_TRACE && 0
-  if (type == 1211){
-    ndbout_c("Startar modul test av Page Manager");
+#if defined VM_TRACE
+  if (type == 1211 || type == 1212 || type == 1213){
+    Uint32 seed = time(0);
+    if (signal->getLength() > 1)
+      seed = signal->theData[1];
+    ndbout_c("Startar modul test av Page Manager (seed: 0x%x)", seed);
+    srand(seed);
 
     Vector<Chunk> chunks;
     const Uint32 LOOPS = 1000;
+    Uint32 sum_req = 0;
+    Uint32 sum_conf = 0;
+    Uint32 sum_loop = 0;
+    Uint32 max_loop = 0;
     for(Uint32 i = 0; i<LOOPS; i++){
 
       // Case
@@ -177,8 +189,15 @@
       if(chunks.size() == 0 && c == 0){
 	c = 1 + rand() % 2;
       }
+      
+      if (type == 1211)
+        ndbout_c("loop=%d case=%d free=%d alloc=%d", i, c, free, alloc);
 
-      ndbout_c("loop=%d case=%d free=%d alloc=%d", i, c, free, alloc);
+      if (type == 1213)
+      {
+        c = 1;
+        alloc = 2 + (sum_conf >> 3) + (sum_conf >> 4);
+      }
       switch(c){ 
       case 0:{ // Release
 	const int ch = rand() % chunks.size();
@@ -190,23 +209,33 @@
       case 2: { // Seize(n) - fail
 	alloc += free;
 	// Fall through
+        sum_req += free;
+        goto doalloc;
       }
       case 1: { // Seize(n) (success)
-
+        sum_req += alloc;
+    doalloc:
 	Chunk chunk;
 	allocConsPages(alloc, chunk.pageCount, chunk.pageId);
 	ndbrequire(chunk.pageCount <= alloc);
 	if(chunk.pageCount != 0){
 	  chunks.push_back(chunk);
 	  if(chunk.pageCount != alloc) {
-	    ndbout_c("  Tried to allocate %d - only allocated %d - free: %d",
-		     alloc, chunk.pageCount, free);
+	    if (type == 1211)
+              ndbout_c("  Tried to allocate %d - only allocated %d - free: %d",
+                       alloc, chunk.pageCount, free);
 	  }
 	} else {
 	  ndbout_c("  Failed to alloc %d pages with %d pages free",
 		   alloc, free);
 	}
 	
+        sum_conf += chunk.pageCount;
+        Uint32 tot = fc_left + fc_right + fc_remove;
+        sum_loop += tot;
+        if (tot > max_loop)
+          max_loop = tot;
+
 	for(Uint32 i = 0; i<chunk.pageCount; i++){
 	  PagePtr pagePtr;
 	  pagePtr.i = chunk.pageId + i;
@@ -225,6 +254,10 @@
       returnCommonArea(chunk.pageId, chunk.pageCount);      
       chunks.erase(chunks.size() - 1);
     }
+
+    ndbout_c("Got %u%% of requested allocs, loops : %u 100*avg: %u max: %u",
+             (100 * sum_conf) / sum_req, sum_loop, 100*sum_loop / LOOPS,
+             max_loop);
   }
 #endif
 }//Dbtup::execDUMP_STATE_ORD()
Thread
bk commit into 5.1 tree (jonas:1.2529)jonas12 Jun