List:Commits« Previous MessageNext Message »
From:jonas Date:February 22 2006 4:29pm
Subject:bk commit into 5.1 tree (jonas:1.2108)
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
  1.2108 06/02/22 17:29:49 jonas@eel.(none) +2 -0
  ndb dd
    some more printouts in unit test of buddy

  storage/ndb/src/kernel/vm/ndbd_malloc_impl.hpp
    1.4 06/02/22 17:29:44 jonas@eel.(none) +5 -1
    Some more util methods

  storage/ndb/src/kernel/vm/ndbd_malloc_impl.cpp
    1.6 06/02/22 17:29:44 jonas@eel.(none) +14 -7
    Some more printouts

# 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:	eel.(none)
# Root:	/home/jonas/src/mysql-5.1-new

--- 1.5/storage/ndb/src/kernel/vm/ndbd_malloc_impl.cpp	2006-02-21 17:29:42 +01:00
+++ 1.6/storage/ndb/src/kernel/vm/ndbd_malloc_impl.cpp	2006-02-22 17:29:44 +01:00
@@ -610,13 +610,18 @@
 int 
 main(int argc, char** argv)
 {
-  int sz = 3*32768;
+  int sz = 1*32768;
+  int run_time = 30;
   if (argc > 1)
     sz = 32*atoi(argv[1]);
 
+  if (argc > 2)
+    run_time = atoi(argv[2]);
+
   char buf[255];
   Timer timer[4];
-  printf("Startar modul test av Page Manager %dMb\n", (sz >> 5));
+  printf("Startar modul test av Page Manager %dMb %ds\n", 
+	 (sz >> 5), run_time);
   g_eventLogger.createConsoleHandler();
   g_eventLogger.setCategory("keso");
   g_eventLogger.enable(Logger::LL_ON, Logger::LL_INFO);
@@ -633,7 +638,7 @@
   rl.m_curr = 0;
   rl.m_resource_id = 0;
   mem.set_resource_limit(rl);
-  rl.m_min = 32768;
+  rl.m_min = sz < 16384 ? sz : 16384;
   rl.m_max = 0;
   rl.m_resource_id = 1;
   mem.set_resource_limit(rl);
@@ -643,13 +648,13 @@
   printf("pid: %d press enter to continue\n", getpid());
   fgets(buf, sizeof(buf), stdin);
   Vector<Chunk> chunks;
-  const Uint32 LOOPS = 100000000;
-  for(Uint32 i = 0; i<LOOPS; i++){
+  time_t stop = time(0) + run_time;
+  for(Uint32 i = 0; time(0) < stop; i++){
     //mem.dump();
     
     // Case
     Uint32 c = (rand() % 100);
-    if (c < 60)
+    if (c < 50)
     {
       c = 0;
     } 
@@ -685,7 +690,7 @@
     }
       break;
     case 2: { // Seize(n) - fail
-      alloc += 32000;
+      alloc += sz;
       // Fall through
     }
     case 1: { // Seize(n) (success)
@@ -741,6 +746,8 @@
   };
   for(Uint32 i = 0; i<4; i++)
     timer[i].print(title[i]);
+
+  mem.dump();
 }
 
 template class Vector<Chunk>;

--- 1.3/storage/ndb/src/kernel/vm/ndbd_malloc_impl.hpp	2006-02-21 09:07:42 +01:00
+++ 1.4/storage/ndb/src/kernel/vm/ndbd_malloc_impl.hpp	2006-02-22 17:29:44 +01:00
@@ -57,7 +57,6 @@
   void set_resource_limit(const Resource_limit& rl);
   
   bool init(bool allow_alloc_less_than_requested = true);
-  void grow(Uint32 start, Uint32 cnt);
   void* get_memroot() const { return (void*)m_base_page;}
   
   void alloc(Uint32* ret, Uint32 *pages, Uint32 min_requested);
@@ -68,6 +67,9 @@
   void* alloc_page(Uint32 type, Uint32* i);
   void release_page(Uint32 type, Uint32 i, void * p);
   
+  void* alloc_pages(Uint32 type, Uint32* i, Uint32 *cnt, Uint32 min = 1);
+  void release_pages(Uint32 type, Uint32 i, void*p, Uint32 cnt);
+  
   /**
    * Compute 2log of size 
    * @note size = 0     -> 0
@@ -76,6 +78,8 @@
   static Uint32 log2(Uint32 size);
 
 private:
+  void grow(Uint32 start, Uint32 cnt);
+
 #define XX_RL_COUNT 3
   /**
    * Return pointer to free page data on page
Thread
bk commit into 5.1 tree (jonas:1.2108)jonas22 Feb