Commit efcd9831 authored by unknown's avatar unknown

ndb dd -

  convert Dbtup::Page_request and pgman::Page_request to WOPool


storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp:
  remove bad method call
storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp:
  Convert disk records to shared global mem users
storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp:
  Convert disk records to shared global mem users
storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp:
  Convert disk records to shared global mem users
storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp:
  Make buddy is initialized first
storage/ndb/src/kernel/blocks/pgman.cpp:
  Convert disk records to shared global mem users
storage/ndb/src/kernel/blocks/pgman.hpp:
  Convert disk records to shared global mem users
storage/ndb/src/kernel/vm/DLFifoList.hpp:
  Made pool templ. ag of DLFifoList + cleanup some
storage/ndb/src/kernel/vm/SLFifoList.hpp:
  Add a few likely's + format some code
storage/ndb/src/kernel/vm/SimulatedBlock.hpp:
  Add records types to blocks includes
parent c5962eb9
...@@ -12381,7 +12381,7 @@ void Dbtc::executeTriggers(Signal* signal, ApiConnectRecordPtr* transPtr) ...@@ -12381,7 +12381,7 @@ void Dbtc::executeTriggers(Signal* signal, ApiConnectRecordPtr* transPtr)
tmp2.release(); tmp2.release();
LocalDataBuffer<11> tmp3(pool, trigPtr.p->afterValues); LocalDataBuffer<11> tmp3(pool, trigPtr.p->afterValues);
tmp3.release(); tmp3.release();
regApiPtr->theFiredTriggers.release(trigPtr.i); regApiPtr->theFiredTriggers.release(trigPtr);
} }
trigPtr = nextTrigPtr; trigPtr = nextTrigPtr;
} }
......
...@@ -469,21 +469,22 @@ typedef Ptr<Fragoperrec> FragoperrecPtr; ...@@ -469,21 +469,22 @@ typedef Ptr<Fragoperrec> FragoperrecPtr;
struct Page_request struct Page_request
{ {
Page_request() {}
Local_key m_key; Local_key m_key;
Uint16 m_estimated_free_space; // in bytes/records
Uint16 m_list_index; // in Disk_alloc_info.m_page_requests
Uint32 m_frag_ptr_i; Uint32 m_frag_ptr_i;
Uint32 m_extent_info_ptr; Uint32 m_extent_info_ptr;
Uint16 m_estimated_free_space; // in bytes/records
Uint16 m_list_index; // in Disk_alloc_info.m_page_requests
Uint16 m_ref_count; // Waiters for page Uint16 m_ref_count; // Waiters for page
Uint16 m_uncommitted_used_space; Uint16 m_uncommitted_used_space;
union {
Uint32 nextList; Uint32 nextList;
Uint32 nextPool;
};
Uint32 prevList; Uint32 prevList;
Uint32 m_magic;
}; // 32 bytes }; // 32 bytes
typedef RecordPool<Page_request, WOPool> Page_request_pool;
typedef DLFifoListImpl<Page_request_pool, Page_request> Page_request_list;
typedef LocalDLFifoListImpl<Page_request_pool, Page_request> Local_page_request_list;
STATIC_CONST( EXTENT_SEARCH_MATRIX_COLS = 4 ); // Guarantee size STATIC_CONST( EXTENT_SEARCH_MATRIX_COLS = 4 ); // Guarantee size
STATIC_CONST( EXTENT_SEARCH_MATRIX_ROWS = 5 ); // Total size STATIC_CONST( EXTENT_SEARCH_MATRIX_ROWS = 5 ); // Total size
STATIC_CONST( EXTENT_SEARCH_MATRIX_SIZE = 20 ); STATIC_CONST( EXTENT_SEARCH_MATRIX_SIZE = 20 );
...@@ -518,7 +519,6 @@ typedef Ptr<Fragoperrec> FragoperrecPtr; ...@@ -518,7 +519,6 @@ typedef Ptr<Fragoperrec> FragoperrecPtr;
}; // 40 bytes }; // 40 bytes
typedef LocalDLList<Extent_info> Extent_list; typedef LocalDLList<Extent_info> Extent_list;
typedef LocalDLList<Page_request> Page_request_list;
struct Tablerec; struct Tablerec;
struct Disk_alloc_info struct Disk_alloc_info
...@@ -553,7 +553,7 @@ typedef Ptr<Fragoperrec> FragoperrecPtr; ...@@ -553,7 +553,7 @@ typedef Ptr<Fragoperrec> FragoperrecPtr;
* Requests (for update) that have sufficient space left after request * Requests (for update) that have sufficient space left after request
* these are currently being "mapped" * these are currently being "mapped"
*/ */
DLList<Page_request>::Head m_page_requests[MAX_FREE_LIST]; Page_request_list::Head m_page_requests[MAX_FREE_LIST];
/** /**
* Current extent * Current extent
...@@ -1010,7 +1010,7 @@ ArrayPool<TupTriggerData> c_triggerPool; ...@@ -1010,7 +1010,7 @@ ArrayPool<TupTriggerData> c_triggerPool;
}; };
ArrayPool<Extent_info> c_extent_pool; ArrayPool<Extent_info> c_extent_pool;
ArrayPool<Page_request> c_page_request_pool; Page_request_pool c_page_request_pool;
DLHashTable<Extent_info> c_extent_hash; DLHashTable<Extent_info> c_extent_hash;
typedef Ptr<Tablerec> TablerecPtr; typedef Ptr<Tablerec> TablerecPtr;
...@@ -2609,13 +2609,6 @@ private: ...@@ -2609,13 +2609,6 @@ private:
void disk_page_free(Signal*, void disk_page_free(Signal*,
Tablerec*, Fragrecord*, Local_key*, PagePtr, Uint32); Tablerec*, Fragrecord*, Local_key*, PagePtr, Uint32);
void disk_page_update_free_space(Fragrecord*, Ptr<Page_request>,
DLList<Page_request>::Head list[],
Uint32 i, Uint32 sz);
void disk_page_update_free_space(Fragrecord*, PagePtr, Uint32 i,
Int32 uncommitted_delta,
Int32 extent_delta);
void disk_page_commit_callback(Signal*, Uint32 opPtrI, Uint32 page_id); void disk_page_commit_callback(Signal*, Uint32 opPtrI, Uint32 page_id);
void disk_page_log_buffer_callback(Signal*, Uint32 opPtrI, Uint32); void disk_page_log_buffer_callback(Signal*, Uint32 opPtrI, Uint32);
......
...@@ -89,7 +89,7 @@ Dbtup::dump_disk_alloc(Dbtup::Disk_alloc_info & alloc) ...@@ -89,7 +89,7 @@ Dbtup::dump_disk_alloc(Dbtup::Disk_alloc_info & alloc)
{ {
printf(" %d : ", i); printf(" %d : ", i);
Ptr<Page_request> ptr; Ptr<Page_request> ptr;
LocalDLList<Page_request> list(c_page_request_pool, Local_page_request_list list(c_page_request_pool,
alloc.m_page_requests[i]); alloc.m_page_requests[i]);
for(list.first(ptr); !ptr.isNull(); list.next(ptr)) for(list.first(ptr); !ptr.isNull(); list.next(ptr))
{ {
...@@ -388,8 +388,6 @@ Dbtup::disk_page_prealloc(Signal* signal, ...@@ -388,8 +388,6 @@ Dbtup::disk_page_prealloc(Signal* signal,
return -err; return -err;
} }
new (req.p) Page_request();
req.p->m_ref_count= 1; req.p->m_ref_count= 1;
req.p->m_frag_ptr_i= fragPtr.i; req.p->m_frag_ptr_i= fragPtr.i;
req.p->m_uncommitted_used_space= sz; req.p->m_uncommitted_used_space= sz;
...@@ -510,7 +508,7 @@ Dbtup::disk_page_prealloc(Signal* signal, ...@@ -510,7 +508,7 @@ Dbtup::disk_page_prealloc(Signal* signal,
// And put page request in correct free list // And put page request in correct free list
idx= alloc.calc_page_free_bits(new_size); idx= alloc.calc_page_free_bits(new_size);
{ {
LocalDLList<Page_request> list(c_page_request_pool, Local_page_request_list list(c_page_request_pool,
alloc.m_page_requests[idx]); alloc.m_page_requests[idx]);
list.add(req); list.add(req);
...@@ -605,9 +603,9 @@ Dbtup::disk_page_prealloc_transit_page(Disk_alloc_info& alloc, ...@@ -605,9 +603,9 @@ Dbtup::disk_page_prealloc_transit_page(Disk_alloc_info& alloc,
if (old_idx != new_idx) if (old_idx != new_idx)
{ {
DLList<Page_request>::Head *lists = alloc.m_page_requests; Page_request_list::Head *lists = alloc.m_page_requests;
LocalDLList<Page_request> old_list(c_page_request_pool, lists[old_idx]); Local_page_request_list old_list(c_page_request_pool, lists[old_idx]);
LocalDLList<Page_request> new_list(c_page_request_pool, lists[new_idx]); Local_page_request_list new_list(c_page_request_pool, lists[new_idx]);
old_list.remove(req); old_list.remove(req);
new_list.add(req); new_list.add(req);
...@@ -761,7 +759,7 @@ Dbtup::disk_page_prealloc_callback_common(Signal* signal, ...@@ -761,7 +759,7 @@ Dbtup::disk_page_prealloc_callback_common(Signal* signal,
} }
{ {
Page_request_list list(c_page_request_pool, Local_page_request_list list(c_page_request_pool,
alloc.m_page_requests[old_idx]); alloc.m_page_requests[old_idx]);
list.release(req); list.release(req);
} }
......
...@@ -309,7 +309,10 @@ void Dbtup::execREAD_CONFIG_REQ(Signal* signal) ...@@ -309,7 +309,10 @@ void Dbtup::execREAD_CONFIG_REQ(Signal* signal)
c_extent_pool.setSize(8192); c_extent_pool.setSize(8192);
c_extent_hash.setSize(1024); // 4k c_extent_hash.setSize(1024); // 4k
c_page_request_pool.setSize(1000);
Pool_context pc;
pc.m_block = this;
c_page_request_pool.wo_pool_init(RT_DBTUP_PAGE_REQUEST, pc);
Uint32 nScanOp; // use TUX config for now Uint32 nScanOp; // use TUX config for now
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUX_SCAN_OP, &nScanOp)); ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUX_SCAN_OP, &nScanOp));
......
...@@ -90,6 +90,7 @@ static BlockInfo ALL_BLOCKS[] = { ...@@ -90,6 +90,7 @@ static BlockInfo ALL_BLOCKS[] = {
static const Uint32 ALL_BLOCKS_SZ = sizeof(ALL_BLOCKS)/sizeof(BlockInfo); static const Uint32 ALL_BLOCKS_SZ = sizeof(ALL_BLOCKS)/sizeof(BlockInfo);
static BlockReference readConfigOrder[ALL_BLOCKS_SZ] = { static BlockReference readConfigOrder[ALL_BLOCKS_SZ] = {
CMVMI_REF,
DBTUP_REF, DBTUP_REF,
DBACC_REF, DBACC_REF,
DBTC_REF, DBTC_REF,
...@@ -100,7 +101,6 @@ static BlockReference readConfigOrder[ALL_BLOCKS_SZ] = { ...@@ -100,7 +101,6 @@ static BlockReference readConfigOrder[ALL_BLOCKS_SZ] = {
NDBFS_REF, NDBFS_REF,
NDBCNTR_REF, NDBCNTR_REF,
QMGR_REF, QMGR_REF,
CMVMI_REF,
TRIX_REF, TRIX_REF,
BACKUP_REF, BACKUP_REF,
DBUTIL_REF, DBUTIL_REF,
......
...@@ -125,11 +125,14 @@ Pgman::execREAD_CONFIG_REQ(Signal* signal) ...@@ -125,11 +125,14 @@ Pgman::execREAD_CONFIG_REQ(Signal* signal)
{ {
page_buffer /= GLOBAL_PAGE_SIZE; // in pages page_buffer /= GLOBAL_PAGE_SIZE; // in pages
m_page_entry_pool.setSize(100*page_buffer); m_page_entry_pool.setSize(100*page_buffer);
m_page_request_pool.setSize(10000);
m_param.m_max_pages = page_buffer; m_param.m_max_pages = page_buffer;
m_param.m_max_hot_pages = (page_buffer * 9) / 10; m_param.m_max_hot_pages = (page_buffer * 9) / 10;
} }
Pool_context pc;
pc.m_block = this;
m_page_request_pool.wo_pool_init(RT_PGMAN_PAGE_REQUEST, pc);
ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend(); ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend();
conf->senderRef = reference(); conf->senderRef = reference();
conf->senderData = senderData; conf->senderData = senderData;
...@@ -977,8 +980,7 @@ Pgman::process_callback(Signal* signal, Ptr<Page_entry> ptr) ...@@ -977,8 +980,7 @@ Pgman::process_callback(Signal* signal, Ptr<Page_entry> ptr)
* Make sure list is in own scope if callback will access this * Make sure list is in own scope if callback will access this
* list again (destructor restores list head). * list again (destructor restores list head).
*/ */
LocalDLFifoList<Page_request> Local_page_request_list req_list(m_page_request_pool, ptr.p->m_requests);
req_list(m_page_request_pool, ptr.p->m_requests);
Ptr<Page_request> req_ptr; Ptr<Page_request> req_ptr;
req_list.first(req_ptr); req_list.first(req_ptr);
...@@ -988,8 +990,6 @@ Pgman::process_callback(Signal* signal, Ptr<Page_entry> ptr) ...@@ -988,8 +990,6 @@ Pgman::process_callback(Signal* signal, Ptr<Page_entry> ptr)
b = globalData.getBlock(req_ptr.p->m_block); b = globalData.getBlock(req_ptr.p->m_block);
callback = req_ptr.p->m_callback; callback = req_ptr.p->m_callback;
req_list.release(req_ptr);
if (req_ptr.p->m_flags & DIRTY_FLAGS) if (req_ptr.p->m_flags & DIRTY_FLAGS)
{ {
jam(); jam();
...@@ -997,6 +997,8 @@ Pgman::process_callback(Signal* signal, Ptr<Page_entry> ptr) ...@@ -997,6 +997,8 @@ Pgman::process_callback(Signal* signal, Ptr<Page_entry> ptr)
ndbassert(ptr.p->m_dirty_count); ndbassert(ptr.p->m_dirty_count);
ptr.p->m_dirty_count --; ptr.p->m_dirty_count --;
} }
req_list.releaseFirst(req_ptr);
} }
ndbrequire(state & Page_entry::BOUND); ndbrequire(state & Page_entry::BOUND);
ndbrequire(state & Page_entry::MAPPED); ndbrequire(state & Page_entry::MAPPED);
...@@ -1602,12 +1604,11 @@ Pgman::get_page(Signal* signal, Ptr<Page_entry> ptr, Page_request page_req) ...@@ -1602,12 +1604,11 @@ Pgman::get_page(Signal* signal, Ptr<Page_entry> ptr, Page_request page_req)
// queue the request // queue the request
Ptr<Pgman::Page_request> req_ptr; Ptr<Pgman::Page_request> req_ptr;
{ {
LocalDLFifoList<Page_request> Local_page_request_list req_list(m_page_request_pool, ptr.p->m_requests);
req_list(m_page_request_pool, ptr.p->m_requests);
if (! (req_flags & Page_request::ALLOC_REQ)) if (! (req_flags & Page_request::ALLOC_REQ))
req_list.seize(req_ptr); req_list.seizeLast(req_ptr);
else else
req_list.seizeFront(req_ptr); req_list.seizeFirst(req_ptr);
} }
if (req_ptr.i == RNIL) if (req_ptr.i == RNIL)
...@@ -2171,8 +2172,8 @@ operator<<(NdbOut& out, Ptr<Pgman::Page_entry> ptr) ...@@ -2171,8 +2172,8 @@ operator<<(NdbOut& out, Ptr<Pgman::Page_entry> ptr)
out << " busy_count=" << dec << pe.m_busy_count; out << " busy_count=" << dec << pe.m_busy_count;
#ifdef VM_TRACE #ifdef VM_TRACE
{ {
LocalDLFifoList<Pgman::Page_request> Local_page_request_list req_list(ptr.p->m_this->m_page_request_pool,
req_list(ptr.p->m_this->m_page_request_pool, ptr.p->m_requests); ptr.p->m_requests);
if (! req_list.isEmpty()) if (! req_list.isEmpty())
{ {
Ptr<Pgman::Page_request> req_ptr; Ptr<Pgman::Page_request> req_ptr;
......
...@@ -262,12 +262,13 @@ private: ...@@ -262,12 +262,13 @@ private:
Uint16 m_flags; Uint16 m_flags;
SimulatedBlock::Callback m_callback; SimulatedBlock::Callback m_callback;
union {
Uint32 nextPool;
Uint32 nextList; Uint32 nextList;
Uint32 m_magic;
}; };
Uint32 prevList;
}; typedef RecordPool<Page_request, WOPool> Page_request_pool;
typedef SLFifoListImpl<Page_request_pool, Page_request> Page_request_list;
typedef LocalSLFifoListImpl<Page_request_pool, Page_request> Local_page_request_list;
struct Page_entry_stack_ptr { struct Page_entry_stack_ptr {
Uint32 nextList; Uint32 nextList;
...@@ -338,7 +339,7 @@ private: ...@@ -338,7 +339,7 @@ private:
Uint32 nextPool; Uint32 nextPool;
}; };
DLFifoList<Page_request>::Head m_requests; Page_request_list::Head m_requests;
Uint32 nextHash; Uint32 nextHash;
Uint32 prevHash; Uint32 prevHash;
...@@ -384,7 +385,7 @@ private: ...@@ -384,7 +385,7 @@ private:
File_map::DataBufferPool m_data_buffer_pool; File_map::DataBufferPool m_data_buffer_pool;
// page entries and requests // page entries and requests
ArrayPool<Page_request> m_page_request_pool; Page_request_pool m_page_request_pool;
ArrayPool<Page_entry> m_page_entry_pool; ArrayPool<Page_entry> m_page_entry_pool;
Page_hashlist m_page_hashlist; Page_hashlist m_page_hashlist;
Page_stack m_page_stack; Page_stack m_page_stack;
......
This diff is collapsed.
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#ifndef SLFIFOLIST_HPP #ifndef SLFIFOLIST_HPP
#define SLFIFOLIST_HPP #define SLFIFOLIST_HPP
#include <ndb_global.h>
#include <kernel_types.h> #include <kernel_types.h>
#include "Pool.hpp" #include "Pool.hpp"
...@@ -154,7 +155,7 @@ inline ...@@ -154,7 +155,7 @@ inline
bool bool
SLFifoListImpl<P,T,U>::seizeFirst(Ptr<T> & p) SLFifoListImpl<P,T,U>::seizeFirst(Ptr<T> & p)
{ {
if (thePool.seize(p)) if (likely(thePool.seize(p)))
{ {
addFirst(p); addFirst(p);
return true; return true;
...@@ -168,7 +169,7 @@ inline ...@@ -168,7 +169,7 @@ inline
bool bool
SLFifoListImpl<P,T,U>::seizeLast(Ptr<T> & p) SLFifoListImpl<P,T,U>::seizeLast(Ptr<T> & p)
{ {
if (thePool.seize(p)) if (likely(thePool.seize(p)))
{ {
addLast(p); addLast(p);
return true; return true;
...@@ -276,7 +277,8 @@ bool ...@@ -276,7 +277,8 @@ bool
SLFifoListImpl<P,T,U>::first(Ptr<T> & p) const SLFifoListImpl<P,T,U>::first(Ptr<T> & p) const
{ {
p.i = head.firstItem; p.i = head.firstItem;
if(p.i != RNIL){ if(p.i != RNIL)
{
p.p = thePool.getPtr(p.i); p.p = thePool.getPtr(p.i);
return true; return true;
} }
...@@ -290,7 +292,8 @@ bool ...@@ -290,7 +292,8 @@ bool
SLFifoListImpl<P,T,U>::last(Ptr<T> & p) const SLFifoListImpl<P,T,U>::last(Ptr<T> & p) const
{ {
p.i = head.lastItem; p.i = head.lastItem;
if(p.i != RNIL){ if(p.i != RNIL)
{
p.p = thePool.getPtr(p.i); p.p = thePool.getPtr(p.i);
return true; return true;
} }
...@@ -304,7 +307,8 @@ bool ...@@ -304,7 +307,8 @@ bool
SLFifoListImpl<P,T,U>::next(Ptr<T> & p) const SLFifoListImpl<P,T,U>::next(Ptr<T> & p) const
{ {
p.i = p.p->U::nextList; p.i = p.p->U::nextList;
if(p.i != RNIL){ if(p.i != RNIL)
{
p.p = thePool.getPtr(p.i); p.p = thePool.getPtr(p.i);
return true; return true;
} }
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
#include <signaldata/ReadConfig.hpp> #include <signaldata/ReadConfig.hpp>
#include <signaldata/UpgradeStartup.hpp> #include <signaldata/UpgradeStartup.hpp>
#include "ndbd_malloc_impl.hpp" #include "ndbd_malloc_impl.hpp"
#include <blocks/record_types.hpp>
/** /**
* Something for filesystem access * Something for filesystem access
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment