libfoedus-core
FOEDUS Core Library
|
A helper class to grab a bunch of pages from multiple nodes in round-robin fashion per chunk. More...
A helper class to grab a bunch of pages from multiple nodes in round-robin fashion per chunk.
This grabs a large number of pages much more efficiently than grabbing one-by-one from individual node. Instead, this is not a true round-robin per page because we switch node only per chunk, which is actually an advantage as it achieves contiguous memory that is friendly for CPU cache. So far this is used when create a new array storage, which requires to grab a large number of pages in round-robin fashion to balance memory usage.
Definition at line 332 of file page_pool.hpp.
#include <page_pool.hpp>
Public Member Functions | |
RoundRobinPageGrabBatch (Engine *engine) | |
~RoundRobinPageGrabBatch () | |
RoundRobinPageGrabBatch ()=delete | |
RoundRobinPageGrabBatch (const RoundRobinPageGrabBatch &)=delete | |
RoundRobinPageGrabBatch & | operator= (const RoundRobinPageGrabBatch &)=delete |
storage::VolatilePagePointer | grab () |
Grabs an in-memory page in some NUMA node. More... | |
void | release_all () |
Called at the end to return all remaining pages to their pools. More... | |
|
explicit |
Definition at line 194 of file page_pool.cpp.
foedus::memory::RoundRobinPageGrabBatch::~RoundRobinPageGrabBatch | ( | ) |
Definition at line 198 of file page_pool.cpp.
References release_all().
|
delete |
|
delete |
storage::VolatilePagePointer foedus::memory::RoundRobinPageGrabBatch::grab | ( | ) |
Grabs an in-memory page in some NUMA node.
This internally batches the pages to return. At the end, call release_all() to release unused pages. Although the type of returned value is VolatilePagePointer, it can be used for snapshot page, too. I just want to return both NUMA node and offset. Maybe we should have another typedef for it.
Definition at line 202 of file page_pool.cpp.
References ASSERT_ND, foedus::memory::PagePoolOffsetChunk::capacity(), foedus::memory::PagePoolOffsetChunk::empty(), foedus::get_error_name(), foedus::Engine::get_memory_manager(), foedus::memory::EngineMemory::get_node_memory(), foedus::memory::PagePool::get_recommended_pages_per_grab(), foedus::memory::PagePool::grab(), foedus::kErrorCodeMemoryNoFreePages, foedus::kErrorCodeOk, foedus::memory::PagePoolOffsetChunk::pop_back(), foedus::print_backtrace(), and foedus::storage::VolatilePagePointer::set().
|
delete |
void foedus::memory::RoundRobinPageGrabBatch::release_all | ( | ) |
Called at the end to return all remaining pages to their pools.
The grabbed pages are not returned, of course.
Definition at line 241 of file page_pool.cpp.
References ASSERT_ND, foedus::memory::PagePoolOffsetChunk::empty(), foedus::Engine::get_memory_manager(), foedus::memory::EngineMemory::get_node_memory(), foedus::memory::NumaNodeMemoryRef::get_volatile_pool(), foedus::memory::PagePool::release(), and foedus::memory::PagePoolOffsetChunk::size().
Referenced by ~RoundRobinPageGrabBatch().