libfoedus-core
FOEDUS Core Library
|
A helper class to grab a bunch of pages from multiple nodes in arbitrary fashion. More...
A helper class to grab a bunch of pages from multiple nodes in arbitrary fashion.
Similar to RoundRobinPageGrabBatch. This class doesn't specify how nodes divvy up pages. The caller has the control. Or, this class provides a method for each policy.
Definition at line 375 of file page_pool.hpp.
#include <page_pool.hpp>
Public Member Functions | |
DivvyupPageGrabBatch (Engine *engine) | |
~DivvyupPageGrabBatch () | |
DivvyupPageGrabBatch ()=delete | |
DivvyupPageGrabBatch (const DivvyupPageGrabBatch &)=delete | |
DivvyupPageGrabBatch & | operator= (const DivvyupPageGrabBatch &)=delete |
storage::VolatilePagePointer | grab (thread::ThreadGroupId node) |
Grabs an in-memory page in specified NUMA node. More... | |
storage::VolatilePagePointer | grab_evenly (uint64_t cur, uint64_t total) |
Grabs an in-memory page evenly and contiguously from each NUMA node. More... | |
void | release_all () |
Called at the end to return all remaining pages to their pools. More... | |
|
explicit |
Definition at line 252 of file page_pool.cpp.
References ASSERT_ND.
foedus::memory::DivvyupPageGrabBatch::~DivvyupPageGrabBatch | ( | ) |
Definition at line 260 of file page_pool.cpp.
References release_all().
|
delete |
|
delete |
storage::VolatilePagePointer foedus::memory::DivvyupPageGrabBatch::grab | ( | thread::ThreadGroupId | node | ) |
Grabs an in-memory page in specified NUMA node.
[in] | node | specify NUMA node |
Definition at line 267 of file page_pool.cpp.
References ASSERT_ND, foedus::memory::PagePoolOffsetChunk::capacity(), 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::NumaNodeMemoryRef::get_volatile_pool(), foedus::memory::PagePool::grab(), foedus::kErrorCodeMemoryNoFreePages, foedus::kErrorCodeOk, and foedus::storage::VolatilePagePointer::set().
Referenced by grab_evenly().
storage::VolatilePagePointer foedus::memory::DivvyupPageGrabBatch::grab_evenly | ( | uint64_t | cur, |
uint64_t | total | ||
) |
Grabs an in-memory page evenly and contiguously from each NUMA node.
[in] | cur | page index out of total. |
[in] | total | total pages to be allocated. |
For example, if total=6 and there are 2 numa nodes, cur=0,1,2 get pages from NUMA node 0, cur=3,4,5 get pages from NUMA node 1. This is the most simple policy.
Definition at line 288 of file page_pool.cpp.
References grab().
|
delete |
void foedus::memory::DivvyupPageGrabBatch::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 298 of file page_pool.cpp.
References ASSERT_ND, foedus::Engine::get_memory_manager(), foedus::memory::EngineMemory::get_node_memory(), foedus::memory::NumaNodeMemoryRef::get_volatile_pool(), and foedus::memory::PagePool::release().
Referenced by ~DivvyupPageGrabBatch().