List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:January 25 2012 2:31pm
Subject:bzr push into mysql-5.1-telco-7.1 branch (jonas.oreland:4436 to 4438)
View as plain text  
 4438 Jonas Oreland	2012-01-25 [merge]
      ndb - merge 70 to 71

    modified:
      storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
      storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
 4437 Jonas Oreland	2012-01-25 [merge]
      ndb - merge 70 to 71

    modified:
      storage/ndb/src/kernel/vm/mt.cpp
 4436 Jonas Oreland	2012-01-25 [merge]
      ndb - merge 70 to 71

    modified:
      storage/ndb/src/kernel/vm/mt.cpp
      storage/ndb/src/mgmsrv/ConfigInfo.cpp
=== modified file 'storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp	2011-12-13 10:46:14 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp	2012-01-25 14:29:38 +0000
@@ -574,7 +574,8 @@ public:
     Uint8 m_last_row;
     Uint8 m_reserved;
     Uint8 statScan;
-    Uint8 dummy[3]; // align?
+    Uint8 m_stop_batch;
+    Uint8 dummy[2]; // align?
   }; // Size 272 bytes
   typedef Ptr<ScanRecord> ScanRecordPtr;
 
@@ -3300,7 +3301,8 @@ Dblqh::ScanRecord::check_scan_batch_comp
   Uint32 max_rows = m_max_batch_size_rows;
   Uint32 max_bytes = m_max_batch_size_bytes;
 
-  return (max_rows > 0 && (m_curr_batch_size_rows >= max_rows))  ||
+  return m_stop_batch ||
+    (max_rows > 0 && (m_curr_batch_size_rows >= max_rows))  ||
     (max_bytes > 0 && (m_curr_batch_size_bytes >= max_bytes));
 }
 

=== modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2012-01-18 09:37:48 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2012-01-25 14:30:53 +0000
@@ -11294,7 +11294,7 @@ void Dblqh::scanTupkeyConfLab(Signal* si
        *
        * TODO: We should have counters for this...
        */
-      tdata5 = 1;
+      scanptr.p->m_stop_batch = 1;
     }
   }
 
@@ -11604,6 +11604,7 @@ Uint32 Dblqh::initScanrec(const ScanFrag
   scanptr.p->scanTcrec = tcConnectptr.i;
   scanptr.p->scanSchemaVersion = scanFragReq->schemaVersion;
 
+  scanptr.p->m_stop_batch = 0;
   scanptr.p->m_curr_batch_size_rows = 0;
   scanptr.p->m_curr_batch_size_bytes= 0;
   scanptr.p->m_max_batch_size_rows = max_rows;
@@ -12091,6 +12092,8 @@ void Dblqh::sendScanFragConf(Signal* sig
     scanptr.p->m_curr_batch_size_rows = 0;
     scanptr.p->m_curr_batch_size_bytes= 0;
   }
+
+  scanptr.p->m_stop_batch = 0;
 }//Dblqh::sendScanFragConf()
 
 /* ######################################################################### */

=== modified file 'storage/ndb/src/kernel/vm/mt.cpp'
--- a/storage/ndb/src/kernel/vm/mt.cpp	2012-01-25 10:38:09 +0000
+++ b/storage/ndb/src/kernel/vm/mt.cpp	2012-01-25 12:37:24 +0000
@@ -424,8 +424,8 @@ struct thr_safe_pool
     }
     else
     {
-      Uint32 dummy;
       unlock(&m_lock);
+      Uint32 dummy;
       ret = reinterpret_cast<T*>
         (mm->alloc_page(rg, &dummy,
                         Ndbd_mem_manager::NDB_ZONE_ANY));
@@ -436,6 +436,49 @@ struct thr_safe_pool
     return ret;
   }
 
+  T* seize_list(Ndbd_mem_manager *mm, Uint32 rg,
+                Uint32 requested, Uint32 * received) {
+    lock(&m_lock);
+    if (m_cnt == 0)
+    {
+      unlock(&m_lock);
+      Uint32 dummy;
+      T* ret = reinterpret_cast<T*>
+        (mm->alloc_page(rg, &dummy,
+                        Ndbd_mem_manager::NDB_ZONE_ANY));
+
+      if (ret == 0)
+      {
+        * received = 0;
+        return 0;
+      }
+      else
+      {
+        ret->m_next = 0;
+        * received = 1;
+        return ret;
+      }
+    }
+    else
+    {
+      if (m_cnt < requested )
+        requested = m_cnt;
+
+      T* first = m_free_list;
+      T* last = first;
+      for (Uint32 i = 1; i < requested; i++)
+      {
+        last = last->m_next;
+      }
+      m_cnt -= requested;
+      m_free_list = last->m_next;
+      unlock(&m_lock);
+      last->m_next = 0;
+      * received = requested;
+      return first;
+    }
+  }
+
   void release(Ndbd_mem_manager *mm, Uint32 rg, T* t) {
     lock(&m_lock);
     t->m_next = m_free_list;
@@ -461,8 +504,10 @@ template<typename T>
 class thread_local_pool
 {
 public:
-  thread_local_pool(thr_safe_pool<T> *global_pool, unsigned max_free) :
+  thread_local_pool(thr_safe_pool<T> *global_pool,
+                    unsigned max_free, unsigned alloc_size = 1) :
     m_max_free(max_free),
+    m_alloc_size(alloc_size),
     m_free(0),
     m_freelist(0),
     m_global_pool(global_pool)
@@ -471,14 +516,16 @@ public:
 
   T *seize(Ndbd_mem_manager *mm, Uint32 rg) {
     T *tmp = m_freelist;
+    if (tmp == 0)
+    {
+      tmp = m_global_pool->seize_list(mm, rg, m_alloc_size, &m_free);
+    }
     if (tmp)
     {
       m_freelist = tmp->m_next;
       assert(m_free > 0);
       m_free--;
     }
-    else
-      tmp = m_global_pool->seize(mm, rg);
 
     validate();
     return tmp;
@@ -589,6 +636,7 @@ public:
 
 private:
   unsigned m_max_free;
+  unsigned m_alloc_size;
   unsigned m_free;
   T *m_freelist;
   thr_safe_pool<T> *m_global_pool;

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.1 branch (jonas.oreland:4436 to 4438) Jonas Oreland25 Jan