Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas 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-05-25 12:26:11+02:00, tomas@stripped +1 -0
Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-telco-gca
into whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-single-user
MERGE: 1.2403.25.4
storage/ndb/src/kernel/blocks/pgman.cpp@stripped, 2007-05-25 12:26:06+02:00, tomas@stripped +0 -0
Auto merged
MERGE: 1.20.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: tomas
# Host: whalegate.ndb.mysql.com
# Root: /home/tomas/mysql-5.1-single-user/RESYNC
--- 1.22/storage/ndb/src/kernel/blocks/pgman.cpp 2007-05-22 17:56:40 +02:00
+++ 1.23/storage/ndb/src/kernel/blocks/pgman.cpp 2007-05-25 12:26:06 +02:00
@@ -123,8 +123,8 @@
if (page_buffer > 0)
{
page_buffer /= GLOBAL_PAGE_SIZE; // in pages
- m_page_entry_pool.setSize(100*page_buffer);
m_param.m_max_pages = page_buffer;
+ m_page_entry_pool.setSize(m_param.m_lirs_stack_mult * page_buffer);
m_param.m_max_hot_pages = (page_buffer * 9) / 10;
}
@@ -141,6 +141,7 @@
Pgman::Param::Param() :
m_max_pages(64), // smallish for testing
+ m_lirs_stack_mult(10),
m_max_hot_pages(56),
m_max_loop_count(256),
m_max_io_waits(64),
@@ -301,6 +302,9 @@
{
return Page_entry::SL_LOCKED;
}
+ if (state == Page_entry::ONSTACK) {
+ return Page_entry::SL_IDLE;
+ }
return Page_entry::SL_OTHER;
}
@@ -415,15 +419,55 @@
{
if (find_page_entry(ptr, file_no, page_no))
{
+ jam();
ndbrequire(ptr.p->m_state != 0);
m_stats.m_page_hits++;
+
+#ifdef VM_TRACE
+ debugOut << "PGMAN: get_page_entry: found" << endl;
+ debugOut << "PGMAN: " << ptr << endl;
+#endif
return true;
}
+ if (m_page_entry_pool.getNoOfFree() == 0)
+ {
+ jam();
+ Page_sublist& pl_idle = *m_page_sublist[Page_entry::SL_IDLE];
+ Ptr<Page_entry> idle_ptr;
+ if (pl_idle.first(idle_ptr))
+ {
+ jam();
+
+#ifdef VM_TRACE
+ debugOut << "PGMAN: get_page_entry: re-use idle entry" << endl;
+ debugOut << "PGMAN: " << idle_ptr << endl;
+#endif
+
+ Page_state state = idle_ptr.p->m_state;
+ ndbrequire(state == Page_entry::ONSTACK);
+
+ Page_stack& pl_stack = m_page_stack;
+ ndbrequire(pl_stack.hasPrev(idle_ptr));
+ pl_stack.remove(idle_ptr);
+ state &= ~ Page_entry::ONSTACK;
+ set_page_state(idle_ptr, state);
+ ndbrequire(idle_ptr.p->m_state == 0);
+
+ release_page_entry(idle_ptr);
+ }
+ }
+
if (seize_page_entry(ptr, file_no, page_no))
{
+ jam();
ndbrequire(ptr.p->m_state == 0);
m_stats.m_page_faults++;
+
+#ifdef VM_TRACE
+ debugOut << "PGMAN: get_page_entry: seize" << endl;
+ debugOut << "PGMAN: " << ptr << endl;
+#endif
return true;
}
@@ -1927,6 +1971,8 @@
break;
case Page_entry::SL_LOCKED:
break;
+ case Page_entry::SL_IDLE:
+ break;
case Page_entry::SL_OTHER:
break;
default:
@@ -1973,8 +2019,11 @@
ndbrequire(stack_count == pl_stack.count() || dump_page_lists());
ndbrequire(queue_count == pl_queue.count() || dump_page_lists());
+ Uint32 hot_count = 0;
Uint32 hot_bound_count = 0;
Uint32 cold_bound_count = 0;
+ Uint32 stack_request_count = 0;
+ Uint32 queue_request_count = 0;
Uint32 i1 = RNIL;
for (pl_stack.first(ptr); ptr.i != RNIL; pl_stack.next(ptr))
@@ -1985,9 +2034,13 @@
ndbrequire(state & Page_entry::ONSTACK || dump_page_lists());
if (! pl_stack.hasPrev(ptr))
ndbrequire(state & Page_entry::HOT || dump_page_lists());
- if (state & Page_entry::HOT &&
- state & Page_entry::BOUND)
- hot_bound_count++;
+ if (state & Page_entry::HOT) {
+ hot_count++;
+ if (state & Page_entry::BOUND)
+ hot_bound_count++;
+ }
+ if (state & Page_entry::REQUEST)
+ stack_request_count++;
}
Uint32 i2 = RNIL;
@@ -1999,6 +2052,8 @@
ndbrequire(state & Page_entry::ONQUEUE || dump_page_lists());
ndbrequire(state & Page_entry::BOUND || dump_page_lists());
cold_bound_count++;
+ if (state & Page_entry::REQUEST)
+ queue_request_count++;
}
Uint32 tot_bound_count =
@@ -2031,7 +2086,11 @@
<< " cache:" << m_stats.m_num_pages
<< "(" << locked_bound_count << "L)"
<< " stack:" << pl_stack.count()
+ << " hot:" << hot_count
+ << " hot_bound:" << hot_bound_count
+ << " stack_request:" << stack_request_count
<< " queue:" << pl_queue.count()
+ << " queue_request:" << queue_request_count
<< " queuewait:" << queuewait_count << endl;
debugOut << "PGMAN:";
@@ -2139,6 +2198,8 @@
return "busy";
case Page_entry::SL_LOCKED:
return "locked";
+ case Page_entry::SL_IDLE:
+ return "idle";
case Page_entry::SL_OTHER:
return "other";
}
| Thread |
|---|
| • bk commit into 5.1 tree (tomas:1.2510) | tomas | 25 May |