18 #ifndef FOEDUS_MEMORY_PAGE_POOL_HPP_
19 #define FOEDUS_MEMORY_PAGE_POOL_HPP_
59 uint32_t
size()
const {
return size_; }
60 bool empty()
const {
return size_ == 0; }
66 return chunk_[--size_];
70 chunk_[size_++] = pointer;
84 : size_(size), padding_(0), chunk_(chunk) {}
87 uint32_t
size()
const {
return size_; }
88 bool empty()
const {
return size_ == 0; }
89 bool full()
const {
return true; }
97 const uint32_t padding_;
130 uint32_t
size()
const {
return size_; }
131 bool empty()
const {
return size_ == 0; }
134 bool is_sorted()
const;
143 chunk_[size_].offset_ = offset;
144 chunk_[size_].safe_epoch_ = safe_epoch.
value();
155 uint32_t get_safe_offset_count(
const Epoch& threshold)
const;
185 uint64_t memory_size,
187 bool rigorous_page_boundary_check);
194 bool is_initialized() const CXX11_OVERRIDE;
197 storage::Page* get_base() const;
199 uint64_t get_free_pool_capacity() const;
200 uint64_t get_memory_size() const;
212 uint32_t get_recommended_pages_per_grab() const;
213 Stat get_stat() const;
214 std::
string get_debug_pool_name() const;
216 void set_debug_pool_name(const
std::
string& name);
262 friend
std::ostream& operator<<(
std::ostream& o, const
PagePool& v);
292 void release(storage::VolatilePagePointer page_id) {
293 release(page_id.get_numa_node(), page_id.get_offset());
315 const uint16_t numa_node_count_;
317 ChunkPtr chunks_[256];
362 const uint16_t numa_node_count_;
411 const uint16_t node_count_;
424 #endif // FOEDUS_MEMORY_PAGE_POOL_HPP_
uint64_t allocated_pages_
Definitions of IDs in this package and a few related constant values.
The pure-virtual interface to initialize/uninitialize non-trivial resources.
Epoch::EpochInteger safe_epoch_
void move_to(PagePoolOffset *destination, uint32_t count)
Page pool for volatile read/write store (VolatilePage) and the read-only bufferpool (SnapshotPage)...
PagePoolOffsetDynamicChunk(uint32_t size, PagePoolOffset *chunk)
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
uint32_t PagePoolOffset
Offset in PagePool that compactly represents the page address (unlike 8 bytes pointer).
Typedefs of ID types used in thread package.
A helper class to grab a bunch of pages from multiple nodes in arbitrary fashion. ...
uint32_t EpochInteger
Unsigned integer representation of epoch.
Represents a pointer to a volatile page with modification count for preventing ABA.
Forward declarations of classes in root package.
Brings error stacktrace information as return value of functions.
Definitions of IDs in this package and a few related constant values.
uint32_t unused_dummy_func_dummy() const
Max number of pointers to pack.
uint32_t capacity() const
void push_back(PagePoolOffset offset, const Epoch &safe_epoch)
#define CXX11_FINAL
Used in public headers in place of "final" of C++11.
Pimpl object of PagePool.
Database engine object that holds all resources and provides APIs.
PagePoolOffsetAndEpochChunk()
uint32_t unused_dummy_func_padding() const
Used to point to an already existing array.
Forward declarations of classes in memory package.
#define CXX11_OVERRIDE
Used in public headers in place of "override" of C++11.
Shared data in PagePoolPimpl.
PagePoolOffset pop_back()
void push_back(PagePoolOffset pointer)
#define CXX11_FUNC_DELETE
Used in public headers in place of " = delete" of C++11.
To reduce the overhead of grabbing/releasing pages from pool, we pack this many pointers for each gra...
#define STATIC_SIZE_CHECK(desired, actual)
uint32_t capacity() const
Used to store an epoch value with each entry in PagePoolOffsetChunk.
uint32_t capacity() const
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
uint8_t ThreadGroupId
Typedef for an ID of ThreadGroup (NUMA node).
ErrorCode
Enum of error codes defined in error_code.xmacro.
A helper class to grab a bunch of pages from multiple nodes in round-robin fashion per chunk...
EpochInteger value() const
Returns the raw integer representation.