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-01 14:44:42+01:00, jonas@eel.(none) +4 -0
ndb - mt
ndbmtd has now roughly same perf as ndbd, single node localhots flexAsynch
ndb/src/kernel/blocks/dblqh/DblqhInit.cpp@stripped, 2007-01-01 14:44:39+01:00, jonas@eel.(none) +1 -0
init cpackedList in constructor to remove need for extra code in vm
ndb/src/kernel/blocks/dbtc/DbtcInit.cpp@stripped, 2007-01-01 14:44:39+01:00, jonas@eel.(none) +1 -0
init cpackedList in constructor to remove need for extra code in vm
ndb/src/kernel/blocks/dbtup/DbtupGen.cpp@stripped, 2007-01-01 14:44:39+01:00, jonas@eel.(none) +1 -1
init cpackedList in constructor to remove need for extra code in vm
ndb/src/kernel/vm/mt/mt.cpp@stripped, 2007-01-01 14:44:39+01:00, jonas@eel.(none) +45 -14
add printout for malloc
add send packed
# 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/50-atrt
--- 1.5/ndb/src/kernel/vm/mt/mt.cpp 2007-01-01 14:44:48 +01:00
+++ 1.6/ndb/src/kernel/vm/mt/mt.cpp 2007-01-01 14:44:48 +01:00
@@ -205,7 +205,7 @@
template<typename T>
struct thr_safe_pool
{
- T* seize() { reinterpret_cast<T*>(malloc(sizeof(T)));}
+ T* seize() { ndbout_c("domalloc"); return reinterpret_cast<T*>(malloc(sizeof(T)));}
};
struct thr_repository
@@ -310,13 +310,15 @@
cnt++;
posptr += siglen;
}
+
return cnt;
}
static
-void
+unsigned
dojoba(struct thr_data* selfptr, Signal* signal, unsigned write_index)
{
+ unsigned sum = 0;
struct thr_job_buffer* buffer;
unsigned read_index = selfptr->m_jba.m_read_index;
unsigned wi_buf = write_index >> 16;
@@ -326,16 +328,18 @@
while (ri_buf != wi_buf)
{
buffer = * (selfptr->m_jba.m_buffers + ri_buf);
- dojob(selfptr, buffer, signal);
+ sum += dojob(selfptr, buffer, signal);
release_buffer(selfptr, buffer);
ri_buf = (ri_buf + 1) % thr_jba::SIZE;
}
buffer = * (selfptr->m_jba.m_buffers + ri_buf);
- dojob(selfptr, buffer, signal);
+ sum += dojob(selfptr, buffer, signal);
unsigned ri_pos = buffer->m_pos;
selfptr->m_jba.m_read_index = (ri_buf << 16) + ri_pos;
+
+ return sum;
}
static
@@ -425,7 +429,7 @@
static
void
-do_send(struct thr_repository* rep, unsigned thr_no)
+do_send(struct thr_repository* rep, struct thr_data* selfptr)
{
static int cnt = 0;
if (cnt == 0)
@@ -440,13 +444,42 @@
static
void
-do_receive(struct thr_repository* rep, unsigned thr_no, unsigned delay)
+do_receive(struct thr_repository*rep, struct thr_data* selfptr, unsigned delay)
{
+ unsigned thr_no = selfptr->m_thr_no;
if (globalTransporterRegistry.pollReceive(delay))
{
globalTransporterRegistry.performReceive();
}
unlock(&rep->m_receive_lock);
+
+ unsigned cnt = rep->m_thread_count;
+
+ /**
+ * Transfer all out buffers
+ */
+ for (unsigned i = 0; i<cnt; i++)
+ {
+ thr_job_buffer * jb = selfptr->m_out_queue[i];
+ if (jb->m_len)
+ {
+ transfer_buffer(rep, thr_no, i);
+ }
+ }
+}
+
+static
+inline
+void
+sendpacked(struct thr_data* selfptr, Signal* signal)
+{
+ SimulatedBlock** blockptr = selfptr->m_blocks - MIN_BLOCK_NO;
+ SimulatedBlock* b_lqh = * (blockptr + DBLQH);
+ SimulatedBlock* b_tc = * (blockptr + DBTC);
+ SimulatedBlock* b_tup = * (blockptr + DBTUP);
+ b_lqh->executeFunction(GSN_SEND_PACKED, signal);
+ b_tc->executeFunction(GSN_SEND_PACKED, signal);
+ b_tup->executeFunction(GSN_SEND_PACKED, signal);
}
void
@@ -455,7 +488,7 @@
Signal signal;
struct timespec nowait;
nowait.tv_sec = 0;
- nowait.tv_nsec = 10000000;
+ nowait.tv_nsec = 10 * 1000000;
struct thr_data* selfptr = rep->m_thread + thr_no;
@@ -465,12 +498,10 @@
unsigned* a_re_idxptr = &selfptr->m_jba.m_read_index;
volatile unsigned * a_wr_idxptr = &selfptr->m_jba.m_write_index;
-
while (globalData.theRestartFlag != perform_stop)
{
unsigned sum = 0;
unsigned cnt = rep->m_thread_count;
- nowait.tv_nsec = 10000000;
scan_time_queues(selfptr);
unsigned jba_read_index = * a_re_idxptr;
@@ -483,8 +514,7 @@
{
if (jba_read_index != jba_write_index)
{
- sum += 0x1000;
- dojoba(selfptr, &signal, jba_write_index);
+ sum += dojoba(selfptr, &signal, jba_write_index);
jba_read_index = * a_re_idxptr;
}
@@ -501,6 +531,8 @@
jba_write_index = * a_wr_idxptr;
}
+ sendpacked(selfptr, &signal);
+
if (sum)
{
/**
@@ -514,17 +546,16 @@
transfer_buffer(rep, thr_no, i);
}
}
- nowait.tv_nsec = 0;
}
if (trylock(&rep->m_send_lock) == 0)
{
- do_send(rep, thr_no);
+ do_send(rep, selfptr);
}
if (trylock(&rep->m_receive_lock) == 0)
{
- do_receive(rep, thr_no, nowait.tv_nsec / 1000000);
+ do_receive(rep, selfptr, sum ? 0 : 10);
}
else
{
--- 1.15/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp 2007-01-01 14:44:48 +01:00
+++ 1.16/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp 2007-01-01 14:44:48 +01:00
@@ -65,6 +65,7 @@
cLqhTimeOutCheckCount = 0;
cbookedAccOps = 0;
c_redo_log_complete_frags = RNIL;
+ cpackedListIndex = 0;
}//Dblqh::initData()
void Dblqh::initRecords()
--- 1.12/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp 2007-01-01 14:44:48 +01:00
+++ 1.13/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp 2007-01-01 14:44:48 +01:00
@@ -303,6 +303,7 @@
tcFailRecord = 0;
c_apiConTimer = 0;
c_apiConTimer_line = 0;
+ cpackedListIndex = 0;
#ifdef VM_TRACE
{
--- 1.19/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp 2007-01-01 14:44:48 +01:00
+++ 1.20/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp 2007-01-01 14:44:48 +01:00
@@ -66,7 +66,7 @@
undoPage = 0;
totNoOfPagesAllocated = 0;
cnoOfAllocatedPages = 0;
-
+ cpackedListIndex = 0;
// Records with constant sizes
}//Dbtup::initData()
| Thread |
|---|
| • bk commit into 5.0 tree (jonas:1.2263) | jonas | 1 Jan |