-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add compile option WITH_PMEM and runtime config enable_pmem #327
Conversation
Signed-off-by: Yu, Peng <peng.yu@intel.com>
0eeb1e1
to
4e33e91
Compare
Signed-off-by: Yu, Peng <peng.yu@intel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please split renaming and feature implementation to two pull requests next time. Renaming messes with formatting and makes code hard to review.
engine/dram_allocator.hpp
Outdated
std::string AllocatorName() override { return "System"; } | ||
|
||
private: | ||
std::atomic<int64_t> bytes_allocated_{0}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential bottleneck.
XADD(fetch_add) usually has a maximum Ops at about 20M for multithreading.
Maybe add a TODO for future optimization here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can record usage with thread cache, like in PMEMAllocator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allocator gets improved now, supporting multi-threads.
@@ -67,21 +67,27 @@ struct SkiplistNode { | |||
// 4 bytes for alignment, the actually allocated size may > 4 | |||
char cached_key[4]; | |||
|
|||
static void DeleteNode(SkiplistNode* node) { free(node->heap_space_start()); } | |||
static void DeleteNode(SkiplistNode* node, Allocator* alloc) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually not a good design, as NewNode and DeleteNode should use the same Allocator and such constraint should be enforced by the class. Skiplist class should hold a pointer to the Allocator, although this may bring 8B DRAM cost.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we have to call DeleteNode without a Skiplist instance, we may leave a TODO here. Some day we should have different SkiplistFactory to create Skiplist with nodes on DRAM/HBM/CXL mempool and each factory should destroy the skiplists created by it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alloc
argument is now removed from these 2 static methods: NewNode()
and DeleteNode()
. Will try to use an allocator
in thread_manager
, accessed by thread local
data. Here, it also handles cases where the thread_manager
is not set.
Signed-off-by: Yu, Peng <peng.yu@intel.com>
Signed-off-by: Yu, Peng <peng.yu@intel.com>
Signed-off-by: Yu, Peng <peng.yu@intel.com>
Signed-off-by: Yu, Peng <peng.yu@intel.com>
Signed-off-by: Yu, Peng <peng.yu@intel.com>
Signed-off-by: Yu, Peng <peng.yu@intel.com>
Signed-off-by: Yu, Peng <peng.yu@intel.com>
7bd6fc0
to
b8a93a4
Compare
Signed-off-by: Yu, Peng <peng.yu@intel.com>
Signed-off-by: Yu, Peng <peng.yu@intel.com>
Signed-off-by: Yu, Peng <peng.yu@intel.com>
Signed-off-by: Yu, Peng <peng.yu@intel.com>
Closing this pull request. It will be split into smaller ones. |
What problem does this PR solve?
Problem Summary: Introducing optional volatile KV storage on DRAM
What is changed and how it works?
What's Changed:
WITH_PMEM
, which isON
by defaultenable_pmem
inKVDK::Configs
, which istrue
by default-DWITH_PMEM=OFF
to remove dependency tolibpmem
-DWITH_PMEM=ON
, settingConfigs.enable_pmem
=false
can make KVDK store data on DRAMCheck List
Tests
Side effects