libfoedus-core
FOEDUS Core Library
foedus::soc::NodeMemoryAnchors Struct Reference

Same as GlobalMemoryAnchors except this is for node_memories_. More...

Detailed Description

Same as GlobalMemoryAnchors except this is for node_memories_.

Definition at line 313 of file shared_memory_repo.hpp.

#include <shared_memory_repo.hpp>

Collaboration diagram for foedus::soc::NodeMemoryAnchors:

Public Types

enum  Constants {
  kChildStatusMemorySize = 1 << 12, kPagePoolMemorySize = 1 << 12, kLogReducerMemorySize = 1 << 12, kLoggerMemorySize = 1 << 21,
  kProcManagerMemorySize = 1 << 12, kMaxBoundaries = 1 << 12
}
 

Public Member Functions

 NodeMemoryAnchors ()
 
 ~NodeMemoryAnchors ()
 
void clear ()
 
 NodeMemoryAnchors (const NodeMemoryAnchors &other)=delete
 
NodeMemoryAnchorsoperator= (const NodeMemoryAnchors &other)=delete
 
void allocate_arrays (const EngineOptions &options)
 
void deallocate_arrays ()
 

Public Attributes

ChildEngineStatuschild_status_memory_
 This tiny piece of memory contains the current status of the child engine on this node. More...
 
memory::PagePoolControlBlockvolatile_pool_status_
 PagePool's status and its synchronization mechanism for the volatile pool on this node. More...
 
proc::ProcManagerControlBlockproc_manager_memory_
 ProcManagers's status and its synchronization mechanism on this node. More...
 
proc::ProcAndNameproc_memory_
 Procedure list on this node. More...
 
proc::LocalProcIdproc_name_sort_memory_
 This memory stores the ID of procedures sorted by their names. More...
 
snapshot::LogReducerControlBlocklog_reducer_memory_
 Tiny control memory for LogReducer in this node. More...
 
void * log_reducer_buffers_ [2]
 Actual buffers for LogReducer. More...
 
storage::Pagelog_reducer_root_info_pages_
 This is the 'output' of the reducer in this node. More...
 
log::LoggerControlBlock ** logger_memories_
 Status and synchronization mechanism for loggers on this node. More...
 
ThreadMemoryAnchorsthread_anchors_
 Anchors for each thread. More...
 
void * volatile_page_pool_
 By far the largest memory for volatile page pool on this node. More...
 
assorted::ProtectedBoundaryprotected_boundaries_ [kMaxBoundaries]
 sanity check boundaries to detect bogus memory accesses that overrun a memory region More...
 
uint32_t protected_boundaries_count_
 To be a POD, we avoid vector and instead uses a fix-sized array. More...
 
bool protected_boundaries_needs_release_
 whether we have invoked mprotect on them More...
 

Member Enumeration Documentation

Constructor & Destructor Documentation

foedus::soc::NodeMemoryAnchors::NodeMemoryAnchors ( )
inline

Definition at line 323 of file shared_memory_repo.hpp.

References clear().

Here is the call graph for this function:

foedus::soc::NodeMemoryAnchors::~NodeMemoryAnchors ( )
inline

Definition at line 324 of file shared_memory_repo.hpp.

References deallocate_arrays().

Here is the call graph for this function:

foedus::soc::NodeMemoryAnchors::NodeMemoryAnchors ( const NodeMemoryAnchors other)
delete

Member Function Documentation

void foedus::soc::NodeMemoryAnchors::allocate_arrays ( const EngineOptions options)

Definition at line 48 of file shared_memory_repo.cpp.

References deallocate_arrays(), foedus::EngineOptions::log_, logger_memories_, foedus::log::LogOptions::loggers_per_node_, foedus::EngineOptions::thread_, thread_anchors_, and foedus::thread::ThreadOptions::thread_count_per_group_.

48  {
50  logger_memories_ = new log::LoggerControlBlock*[options.log_.loggers_per_node_];
51  thread_anchors_ = new ThreadMemoryAnchors[options.thread_.thread_count_per_group_];
52 }
log::LoggerControlBlock ** logger_memories_
Status and synchronization mechanism for loggers on this node.
ThreadMemoryAnchors * thread_anchors_
Anchors for each thread.

Here is the call graph for this function:

void foedus::soc::NodeMemoryAnchors::clear ( )
inline

Definition at line 325 of file shared_memory_repo.hpp.

Referenced by NodeMemoryAnchors().

325 { std::memset(this, 0, sizeof(*this)); }

Here is the caller graph for this function:

void foedus::soc::NodeMemoryAnchors::deallocate_arrays ( )

Definition at line 54 of file shared_memory_repo.cpp.

References logger_memories_, and thread_anchors_.

Referenced by allocate_arrays(), and ~NodeMemoryAnchors().

54  {
55  if (logger_memories_) {
56  delete[] logger_memories_;
57  logger_memories_ = nullptr;
58  }
59  if (thread_anchors_) {
60  delete[] thread_anchors_;
61  thread_anchors_ = nullptr;
62  }
63 }
log::LoggerControlBlock ** logger_memories_
Status and synchronization mechanism for loggers on this node.
ThreadMemoryAnchors * thread_anchors_
Anchors for each thread.

Here is the caller graph for this function:

NodeMemoryAnchors& foedus::soc::NodeMemoryAnchors::operator= ( const NodeMemoryAnchors other)
delete

Member Data Documentation

void* foedus::soc::NodeMemoryAnchors::log_reducer_buffers_[2]

Actual buffers for LogReducer.

Two for switching. Size is SnapshotOptions::log_reducer_buffer_mb_ in total of the two.

Definition at line 373 of file shared_memory_repo.hpp.

Referenced by foedus::snapshot::LogReducerRef::get_buffer(), foedus::snapshot::LogReducer::LogReducer(), and foedus::snapshot::LogReducerRef::LogReducerRef().

snapshot::LogReducerControlBlock* foedus::soc::NodeMemoryAnchors::log_reducer_memory_

Tiny control memory for LogReducer in this node.

Always 4kb. The reducer buffers are allocated separately below.

Definition at line 367 of file shared_memory_repo.hpp.

Referenced by foedus::snapshot::LogReducer::LogReducer(), and foedus::snapshot::LogReducerRef::LogReducerRef().

storage::Page* foedus::soc::NodeMemoryAnchors::log_reducer_root_info_pages_

This is the 'output' of the reducer in this node.

Each page contains a root-info page of one storage processed in the reducer. Size is StorageOptions::max_storages_ * 4kb.

Definition at line 380 of file shared_memory_repo.hpp.

Referenced by foedus::snapshot::LogReducer::LogReducer(), and foedus::snapshot::LogReducerRef::LogReducerRef().

log::LoggerControlBlock** foedus::soc::NodeMemoryAnchors::logger_memories_

Status and synchronization mechanism for loggers on this node.

Index is node-local logger ID. 4kb for each logger.

Definition at line 387 of file shared_memory_repo.hpp.

Referenced by allocate_arrays(), deallocate_arrays(), and foedus::log::LogManagerPimpl::initialize_once().

proc::ProcManagerControlBlock* foedus::soc::NodeMemoryAnchors::proc_manager_memory_

ProcManagers's status and its synchronization mechanism on this node.

Always 4kb.

Definition at line 350 of file shared_memory_repo.hpp.

Referenced by foedus::proc::ProcManagerPimpl::initialize_once().

proc::ProcAndName* foedus::soc::NodeMemoryAnchors::proc_memory_

Procedure list on this node.

The size is sizeof(proc::ProcAndName) * ProcOptions::max_proc_count_.

Definition at line 355 of file shared_memory_repo.hpp.

Referenced by foedus::proc::ProcManagerPimpl::initialize_once().

proc::LocalProcId* foedus::soc::NodeMemoryAnchors::proc_name_sort_memory_

This memory stores the ID of procedures sorted by their names.

The size is 4 (=sizeof(LocalProcId)) * ProcOptions::max_proc_count_.

Definition at line 360 of file shared_memory_repo.hpp.

Referenced by foedus::proc::ProcManagerPimpl::initialize_once().

assorted::ProtectedBoundary* foedus::soc::NodeMemoryAnchors::protected_boundaries_[kMaxBoundaries]

sanity check boundaries to detect bogus memory accesses that overrun a memory region

Definition at line 398 of file shared_memory_repo.hpp.

Referenced by foedus::soc::SharedMemoryRepo::deallocate_shared_memories().

uint32_t foedus::soc::NodeMemoryAnchors::protected_boundaries_count_

To be a POD, we avoid vector and instead uses a fix-sized array.

Definition at line 400 of file shared_memory_repo.hpp.

Referenced by foedus::soc::SharedMemoryRepo::deallocate_shared_memories().

bool foedus::soc::NodeMemoryAnchors::protected_boundaries_needs_release_

whether we have invoked mprotect on them

Definition at line 402 of file shared_memory_repo.hpp.

ThreadMemoryAnchors* foedus::soc::NodeMemoryAnchors::thread_anchors_

Anchors for each thread.

Index is node-local thread ordinal.

Definition at line 392 of file shared_memory_repo.hpp.

Referenced by allocate_arrays(), deallocate_arrays(), and foedus::soc::SharedMemoryRepo::get_thread_memory_anchors().

void* foedus::soc::NodeMemoryAnchors::volatile_page_pool_

By far the largest memory for volatile page pool on this node.

Definition at line 395 of file shared_memory_repo.hpp.

Referenced by foedus::soc::SharedMemoryRepo::get_volatile_pool().

memory::PagePoolControlBlock* foedus::soc::NodeMemoryAnchors::volatile_pool_status_

PagePool's status and its synchronization mechanism for the volatile pool on this node.

Always 4kb.

Definition at line 344 of file shared_memory_repo.hpp.

Referenced by foedus::memory::NumaNodeMemory::initialize_once(), and foedus::memory::NumaNodeMemoryRef::NumaNodeMemoryRef().


The documentation for this struct was generated from the following files: